Skip to content

Commit 96ad568

Browse files
committed
JSD: Add rebuild SLA function
1 parent dccd662 commit 96ad568

File tree

6 files changed

+19
-5
lines changed

6 files changed

+19
-5
lines changed

README.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ It is based on the official REST APIs of these products, as well as additional p
1111
(such as xml+rpc and raw HTTP requests).
1212
This library can be used to automate tasks, integrate with other tools and systems,
1313
and build custom applications that interact with Atlassian products.
14-
It supports a wide range of Atlassian products, including Jira, Confluence, Bitbucket, and others,
14+
It supports a wide range of Atlassian products, including Jira, Confluence, Bitbucket, StatusPage and others,
1515
and is compatible with both Atlassian Server and Cloud instances.
1616

1717
Overall, the **atlassian-python-api** is a useful tool for Python developers who want to work with Atlassian products.
@@ -63,6 +63,7 @@ Here's a short example of how to create a Confluence page:
6363
6464
print(status)
6565
66+
Please, note Confluence Cloud need to be used via token parameter.
6667
And here's another example of how to get issues from Jira using JQL Query:
6768

6869
.. code-block:: python

atlassian/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.35.0
1+
3.36.0

atlassian/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .jira import Jira
99
from .marketplace import MarketPlace
1010
from .portfolio import Portfolio
11-
from .service_desk import ServiceDesk
11+
from .service_desk import ServiceDesk as ServiceManagement
1212
from .xray import Xray
1313

1414

atlassian/confluence.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def get_child_pages(self, page_id):
207207
"""
208208
return self.get_page_child_by_type(page_id=page_id, type="page")
209209

210-
def get_page_id(self, space, title, type='page'):
210+
def get_page_id(self, space, title, type="page"):
211211
"""
212212
Provide content id from search result by title and space
213213
:param space: SPACE key
@@ -270,7 +270,7 @@ def get_pages_by_title(self, space, title, start=0, limit=200, expand=None):
270270
"""
271271
return self.get_page_by_title(space, title, start, limit, expand)
272272

273-
def get_page_by_title(self, space, title, start=0, limit=1, expand=None, type='page'):
273+
def get_page_by_title(self, space, title, start=0, limit=1, expand=None, type="page"):
274274
"""
275275
Returns the first page on a piece of Content.
276276
:param space: Space key

atlassian/service_desk.py

+12
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,18 @@ def get_sla_by_id(self, issue_id_or_key, sla_id):
612612

613613
return self.get(url, headers=self.experimental_headers)
614614

615+
def sla_rebuild(self, tickets=None):
616+
"""
617+
Fix corrupted or missing sla
618+
https://confluence.atlassian.com/jirakb/missing-or-corrupted-sla-data-in-jira-service-management-828790603.html
619+
:param tickets: list of tickets like [XXX-123, XXX-124]
620+
:return:
621+
"""
622+
if tickets is None:
623+
tickets = []
624+
url = "rest/servicedesk/1/servicedesk/sla/admin/task/destructive/reconstruct"
625+
return self.post(url, data=tickets)
626+
615627
# Approvals
616628

617629
def get_approvals(self, issue_id_or_key, start=0, limit=50):

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"Programming Language :: Python :: 3.8",
5151
"Programming Language :: Python :: 3.9",
5252
"Programming Language :: Python :: 3.10",
53+
"Programming Language :: Python :: 3.11",
5354
"Topic :: Utilities",
5455
"Topic :: Internet",
5556
"Topic :: Internet :: WWW/HTTP",

0 commit comments

Comments
 (0)