Skip to content

Commit ebb1069

Browse files
author
Gonchik Tsymzhitov
committed
Jira: Add notification scheme locator
1 parent 554bfd5 commit ebb1069

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

atlassian/jira.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,21 @@ def assign_priority_scheme_for_project(self, project_key_or_id, priority_scheme_
17491749
data = {"id": priority_scheme_id}
17501750
return self.put(url, data=data)
17511751

1752+
def get_priority_scheme_of_project(self, project_key_or_id, expand=None):
1753+
"""
1754+
Resource for associating notification schemes and projects.
1755+
Gets a notification scheme associated with the project.
1756+
Follow the documentation of /notificationscheme/{id} resource for all details about returned value.
1757+
:param project_key_or_id:
1758+
:param expand: notificationSchemeEvents,user,group,projectRole,field,all
1759+
:return:
1760+
"""
1761+
params = {}
1762+
if expand:
1763+
params["expand"] = expand
1764+
url = "rest/api/2/project/{}/notificationscheme".format(project_key_or_id)
1765+
return self.get(url, params=params)
1766+
17521767
# Application properties
17531768
def get_property(self, key=None, permission_level=None, key_filter=None):
17541769
"""

docs/jira.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ Manage projects
134134
# Use only_levels=True for get the only levels entries
135135
jira.get_project_issue_security_scheme(project_id_or_key, only_levels=False)
136136
137+
# Resource for associating notification schemes and projects.
138+
# Gets a notification scheme associated with the project.
139+
# Follow the documentation of /notificationscheme/{id} resource for all details about returned value.
140+
# Use 'expand' to get details (default is None) possible values are notificationSchemeEvents,user,group,projectRole,field,all
141+
jira.get_priority_scheme_of_project(project_key_or_id, expand=None)
142+
137143
138144
Manage issues
139145
-------------

0 commit comments

Comments
 (0)