atlassian-python-api 4.0.5__py3-none-any.whl → 4.0.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
atlassian/VERSION CHANGED
@@ -1 +1 @@
1
- 4.0.5
1
+ 4.0.6
@@ -1,5 +1,6 @@
1
1
  from ..base import BitbucketCloudBase
2
2
  from ..common.users import User
3
+ from ..common.users import AppUser
3
4
 
4
5
 
5
6
  class Comment(BitbucketCloudBase):
@@ -31,6 +32,9 @@ class Comment(BitbucketCloudBase):
31
32
  @property
32
33
  def user(self):
33
34
  """User object with user information of the comment."""
35
+ if self.get_data("user")["type"] == "app_user":
36
+ # If the participant is an app user, return an AppUser instance
37
+ return AppUser(None, self.get_data("user"), **self._new_session_args)
34
38
  return User(None, self.get_data("user"), **self._new_session_args)
35
39
 
36
40
  def update(self, **kwargs):
@@ -87,9 +87,9 @@ class Participant(BitbucketCloudBase):
87
87
  @property
88
88
  def user(self):
89
89
  """User object with user information of the participant."""
90
- if self.get_data("type") == "app_user":
90
+ if self.get_data("user")["type"] == "app_user":
91
91
  # If the participant is an app user, return an AppUser instance
92
- return AppUser(None, self.get_data("app_user"), **self._new_session_args)
92
+ return AppUser(None, self.get_data("user"), **self._new_session_args)
93
93
  return User(None, self.get_data("user"), **self._new_session_args)
94
94
 
95
95
  @property
@@ -3,7 +3,7 @@
3
3
  from ..base import BitbucketCloudBase
4
4
  from ..common.builds import Build
5
5
  from ..common.comments import Comment
6
- from ..common.users import Participant, User
6
+ from ..common.users import Participant, User, AppUser
7
7
 
8
8
 
9
9
  class Commits(BitbucketCloudBase):
@@ -89,6 +89,9 @@ class Commit(BitbucketCloudBase):
89
89
  @property
90
90
  def author(self):
91
91
  """User object of the author."""
92
+ if self.get_data("author")["type"] == "app_user":
93
+ # If the author is an app user, return an AppUser instance
94
+ return AppUser(None, self.get_data("author").get("user"), **self._new_session_args)
92
95
  return User(None, self.get_data("author").get("user"))
93
96
 
94
97
  def parents(self):
@@ -5,7 +5,7 @@ from .diffstat import DiffStat
5
5
  from ...cloud.repositories.commits import Commit
6
6
  from ..common.builds import Build
7
7
  from ..common.comments import Comment
8
- from ..common.users import User, Participant
8
+ from ..common.users import User, Participant, AppUser
9
9
 
10
10
 
11
11
  class PullRequests(BitbucketCloudBase):
@@ -209,6 +209,9 @@ class PullRequest(BitbucketCloudBase):
209
209
  @property
210
210
  def author(self):
211
211
  """User object of the author"""
212
+ if self.get_data("author")["type"] == "app_user":
213
+ # If the author is an app user, return an AppUser instance
214
+ return AppUser(None, self.get_data("author"), **self._new_session_args)
212
215
  return User(None, self.get_data("author"))
213
216
 
214
217
  @property
@@ -451,11 +454,17 @@ class Task(BitbucketCloudBase):
451
454
  @property
452
455
  def creator(self):
453
456
  """User object with user information of the task creator"""
457
+ if self.get_data("creator")["type"] == "app_user":
458
+ # If the creator is an app user, return an AppUser instance
459
+ return AppUser(None, self.get_data("creator"), **self._new_session_args)
454
460
  return User(None, self.get_data("creator"), **self._new_session_args)
455
461
 
456
462
  @property
457
463
  def resolved_by(self):
458
464
  """User object with user information of the task resolver"""
465
+ if self.get_data("resolved_by")["type"] == "app_user":
466
+ # If the resolver is an app user, return an AppUser instance
467
+ return AppUser(None, self.get_data("resolved_by"), **self._new_session_args)
459
468
  return User(None, self.get_data("resolved_by"), **self._new_session_args)
460
469
 
461
470
  def update(self, raw_message):
@@ -1,7 +1,7 @@
1
1
  # coding=utf-8
2
2
 
3
3
  from ..base import BitbucketCloudBase
4
- from ..common.users import User
4
+ from ..common.users import User, AppUser
5
5
 
6
6
 
7
7
  class Refs(BitbucketCloudBase):
@@ -120,6 +120,9 @@ class Branch(Ref):
120
120
  @property
121
121
  def author(self):
122
122
  """User object of the author."""
123
+ if self.get_data("author")["type"] == "app_user":
124
+ # If the author is an app user, return an AppUser instance
125
+ return AppUser(None, self.get_data("author").get("user"), **self._new_session_args)
123
126
  return User(None, self.get_data("author"))
124
127
 
125
128
 
@@ -682,7 +682,7 @@ class Confluence(AtlassianRestAPI):
682
682
  all_pages.extend(results) # Add the current batch of pages to the list
683
683
 
684
684
  # Break the loop if no more pages are available
685
- if len(results) < limit:
685
+ if len(results) <= limit:
686
686
  break
687
687
 
688
688
  # Increment the start index for the next batch
atlassian/jira.py CHANGED
@@ -3559,7 +3559,10 @@ class Jira(AtlassianRestAPI):
3559
3559
  params["expand"] = expand
3560
3560
  if validate_query is not None:
3561
3561
  params["validateQuery"] = validate_query
3562
- url = self.resource_url("search")
3562
+ if self.cloud:
3563
+ url = self.resource_url("search")
3564
+ else:
3565
+ url = self.resource_url("search/jql")
3563
3566
  return self.get(url, params=params)
3564
3567
 
3565
3568
  def enhanced_jql(
@@ -3619,6 +3622,39 @@ class Jira(AtlassianRestAPI):
3619
3622
  url = self.resource_url("search/approximate-count")
3620
3623
  return self.post(url, data)
3621
3624
 
3625
+ def match_jql(self, issue_ids: List[int], jqls: List[str]) -> Optional[dict[Any, Any]]:
3626
+ """
3627
+ Checks which issues match a list of JQL queries.
3628
+
3629
+ This method corresponds to the /rest/api/3/jql/match endpoint.
3630
+ It helps you verify if a set of issues would be returned by given JQL queries.
3631
+
3632
+ :param issue_ids: A list of issue IDs to be checked against the JQLs.
3633
+ :param jqls: A list of JQL query strings to match.
3634
+ :return: A dictionary containing the matching results from the API.
3635
+ For example:
3636
+ {
3637
+ "errors": [],
3638
+ "results": [
3639
+ {
3640
+ "matchedIssues": [10001],
3641
+ "errors": [],
3642
+ "jql": "project = FOO"
3643
+ },
3644
+ {
3645
+ "matchedIssues": ,
3646
+ "errors": [],
3647
+ "jql": "issuetype = Bug"
3648
+ }
3649
+ ]
3650
+ }
3651
+ """
3652
+ if not self.cloud:
3653
+ raise ValueError("``approximate_issue_count`` method is only available for Jira Cloud platform")
3654
+ payload = {"issueIds": issue_ids, "jqls": jqls}
3655
+ url = self.resource_url("jql/match")
3656
+ return self.post(url, data=payload)
3657
+
3622
3658
  def jql_get_list_of_tickets(
3623
3659
  self,
3624
3660
  jql: str,
@@ -3665,7 +3701,10 @@ class Jira(AtlassianRestAPI):
3665
3701
  params["expand"] = expand
3666
3702
  if validate_query is not None:
3667
3703
  params["validateQuery"] = validate_query
3668
- url = self.resource_url("search")
3704
+ if self.cloud:
3705
+ url = self.resource_url("search")
3706
+ else:
3707
+ url = self.resource_url("search/jql")
3669
3708
 
3670
3709
  results: List[object] = []
3671
3710
  while True:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atlassian-python-api
3
- Version: 4.0.5
3
+ Version: 4.0.6
4
4
  Summary: Python Atlassian REST API Wrapper
5
5
  Home-page: https://github.com/atlassian-api/atlassian-python-api
6
6
  Download-URL: https://github.com/atlassian-api/atlassian-python-api
@@ -1,4 +1,4 @@
1
- atlassian/VERSION,sha256=e6Kqq4wdctKTvOeDmNkTKHktrDae75nJbVjcfEKYr4o,5
1
+ atlassian/VERSION,sha256=YMHNtaPhTP-lMMqGnKNyXk_q6TDsyXkog0aHYOdpQnA,5
2
2
  atlassian/__init__.py,sha256=CpswvfzfMsXkY0aaM-ywYqsVE82OJrLiFCFOFDTt8qI,906
3
3
  atlassian/assets.py,sha256=P3Cm9UnR1dbcoRm0uZvOnZzcY2TSxJ_iH2llYqEF7Ck,21611
4
4
  atlassian/bamboo.py,sha256=-KlqEJsMV1ZsM-em-6NmuU1JjBrO7seu07I5byus2rY,48018
@@ -6,7 +6,7 @@ atlassian/cloud_admin.py,sha256=pRLPR1-pOdvnH-H56PxtTrtW1ok_HrM2LCmvsyLlzss,4054
6
6
  atlassian/crowd.py,sha256=hsLqcmKLm-qWK3xV1pDYCeGcvUIR8k6DJkMlwcDn8QM,9255
7
7
  atlassian/errors.py,sha256=5Ob7l1ZCF2-mjejJyVt0bkvDZxoUGZVaMdLpeFxasVk,569
8
8
  atlassian/insight.py,sha256=H9ZZz73A6jXcvM2ng8Mho5jWHOljB3XIjFCki3t_6ic,23399
9
- atlassian/jira.py,sha256=EwzQTSMwMJe1B-axW8JWTi15egy8qgj4-B_FXr5Hfxs,227785
9
+ atlassian/jira.py,sha256=wCg3uEHO09rDl_3_FqkMcLiweA18Cxk2rtsnd58pyQk,229359
10
10
  atlassian/marketplace.py,sha256=dLm4I8GROkdhyu3BdGtK_ssq1g44KZFi8S0HS_ZepLs,2540
11
11
  atlassian/portfolio.py,sha256=q38sFFC7DHmHM4vsFzl8sT7HcRRGKH3tT5nRlqltDzc,3696
12
12
  atlassian/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -23,11 +23,11 @@ atlassian/bitbucket/cloud/__init__.py,sha256=IDw6mMXXaI_KipT08Ff5duS2NiKoSX1F0Hq
23
23
  atlassian/bitbucket/cloud/base.py,sha256=zG50qqMgqyV2KJdUxn5KIdTBLA26wq0-Tk1gyBq8k9g,4267
24
24
  atlassian/bitbucket/cloud/common/__init__.py,sha256=xhpE0cKTpx6a1jjazmjIexNFuq0a5gpzefmM_NnH7fw,37
25
25
  atlassian/bitbucket/cloud/common/builds.py,sha256=S9Ox26WDiFjdHU9XqEVQz7ddC4LV3f4h55L9-ITIAnE,2374
26
- atlassian/bitbucket/cloud/common/comments.py,sha256=ktnN9G0Vr49rIAeqTElnEXvpePp6roUw_Om06JnEb-4,1329
27
- atlassian/bitbucket/cloud/common/users.py,sha256=_1mvbcGExvZgZ_dZyffjS2RE58lnVZQA47sbnlPrgK4,3716
26
+ atlassian/bitbucket/cloud/common/comments.py,sha256=O140p9sstUBBlB0rwHpspYVXfoxRD6heeP3oyOShRSA,1578
27
+ atlassian/bitbucket/cloud/common/users.py,sha256=Z1lX4vgriAh9cJlHVMra4CcgSe9Sj1x-DpMa7623oIU,3720
28
28
  atlassian/bitbucket/cloud/repositories/__init__.py,sha256=9xZM6DUdAzj_GThgOfABm-uAYz4pMO9DrIznuvmD4GU,17241
29
29
  atlassian/bitbucket/cloud/repositories/branchRestrictions.py,sha256=Gr0_DYIQHtd2lyVEBqUiUXg6Y_xumRn10UgKo6iF8ck,6535
30
- atlassian/bitbucket/cloud/repositories/commits.py,sha256=RvwTr7dMzQEuuZ6DFMfCfPhv33o7r1rtsPIT5es16dI,7752
30
+ atlassian/bitbucket/cloud/repositories/commits.py,sha256=DVGHC5rSdK5blUgl32jJmPs9-xsAIEGeRFc_2bHPNeQ,7986
31
31
  atlassian/bitbucket/cloud/repositories/defaultReviewers.py,sha256=MLjjZP8wkIX8wYh87IpXrYXUVgZcld8AbJU1AC1u-VE,3592
32
32
  atlassian/bitbucket/cloud/repositories/deploymentEnvironments.py,sha256=eouHjBORdEJSyuccUy2Gsdm-ZdKkvJ7oJmj8P6fWtKk,9385
33
33
  atlassian/bitbucket/cloud/repositories/diffstat.py,sha256=tzi9mDC71Jps-Lj_UdvR3mUb1nFlbN2DZ1bjHfGu26A,2893
@@ -36,8 +36,8 @@ atlassian/bitbucket/cloud/repositories/groupPermissions.py,sha256=yMSlQKvrQ5rFx3
36
36
  atlassian/bitbucket/cloud/repositories/hooks.py,sha256=quPT8F9la2Vz5Rh-CUsUwC7V_7U3Zv9VSTSmcDGX9_w,3193
37
37
  atlassian/bitbucket/cloud/repositories/issues.py,sha256=rJzPfhETsI7qqi9xyo_MwaTPnwxmQe2pyBYTLyMf9Eg,5065
38
38
  atlassian/bitbucket/cloud/repositories/pipelines.py,sha256=dqGkOauMtr1Baue7ICtW7KQ0EaW-3aj2Hln3dCrFexM,9129
39
- atlassian/bitbucket/cloud/repositories/pullRequests.py,sha256=NwQSQwRkpfRcUTQ5QnuL-xpQydjLeDt2kE47Nf72o78,16245
40
- atlassian/bitbucket/cloud/repositories/refs.py,sha256=hrZKaXa7_7PYO7bNGkdq6onF8YB46eBhLd56o1miEfY,4013
39
+ atlassian/bitbucket/cloud/repositories/pullRequests.py,sha256=WQBm6gTZXTIJkypUekdBsBBA5yWlUYprWV6KxYTg2iM,16908
40
+ atlassian/bitbucket/cloud/repositories/refs.py,sha256=1jMcPh03owE_NcMQXuhu0vo2h-sXyuhQaXB1DSUPvQ8,4247
41
41
  atlassian/bitbucket/cloud/repositories/repositoryVariables.py,sha256=6MAWI0vhJg71tKHVh-bfcaonXuy90lq3BEsjMl0rv2c,5088
42
42
  atlassian/bitbucket/cloud/workspaces/__init__.py,sha256=Pos5ktbVEqfcP6tTV5P-DzZL43ElDSjYT9y1CLgJnrM,5081
43
43
  atlassian/bitbucket/cloud/workspaces/members.py,sha256=fFP4ubBurFkMTDvZrQKSz5KN3cSVZnT1OBff2g8qYlE,1775
@@ -50,9 +50,9 @@ atlassian/bitbucket/server/common/__init__.py,sha256=woZpR3WXAA3A99hZ1UZI_gLPHaA
50
50
  atlassian/bitbucket/server/common/permissions.py,sha256=ve-hWRIrG0zSMo1hp2uTLHGO1PlXorzZlpt7Sc9KhJw,7300
51
51
  atlassian/bitbucket/server/projects/__init__.py,sha256=6G3MZBOTFpwx5x3chg-M8-BbmOnrdRZiZYp2YKJScbw,7668
52
52
  atlassian/bitbucket/server/projects/repos/__init__.py,sha256=RFnZ5APax9VXASYbHbMjW12L2NR4gWbXzS-c-KyExTI,10776
53
- atlassian/confluence/__init__.py,sha256=Z6OREX2lLJ9DwAW6WOUc50Hf0NwMTit1rolVKrgUjIE,154599
54
- atlassian_python_api-4.0.5.dist-info/licenses/LICENSE,sha256=xamAnoX0zfBamIilAfP3nSIt7dIvnj7oueX14l6uKPY,11335
55
- atlassian_python_api-4.0.5.dist-info/METADATA,sha256=4qMfF0_XiCYKheCJaq1zB3UvCP-Eug4Tjuqu5QsqrVs,9525
56
- atlassian_python_api-4.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
57
- atlassian_python_api-4.0.5.dist-info/top_level.txt,sha256=84-EDv8LNaZx01TCGjBzglwPU1JSRJ7fPSq9uy55Sv0,10
58
- atlassian_python_api-4.0.5.dist-info/RECORD,,
53
+ atlassian/confluence/__init__.py,sha256=rAo1C5G5kJyBwfFvMcJCVy7i7eVz10itV1dB2y0AcTA,154600
54
+ atlassian_python_api-4.0.6.dist-info/licenses/LICENSE,sha256=xamAnoX0zfBamIilAfP3nSIt7dIvnj7oueX14l6uKPY,11335
55
+ atlassian_python_api-4.0.6.dist-info/METADATA,sha256=pZtch3ngfxwi3m6n6asKsfoav7xxDNvute77JElLiPc,9525
56
+ atlassian_python_api-4.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
57
+ atlassian_python_api-4.0.6.dist-info/top_level.txt,sha256=84-EDv8LNaZx01TCGjBzglwPU1JSRJ7fPSq9uy55Sv0,10
58
+ atlassian_python_api-4.0.6.dist-info/RECORD,,