Skip to content

Commit

Permalink
JSD: Add rebuild SLA function
Browse files Browse the repository at this point in the history
  • Loading branch information
gonchik committed Apr 2, 2023
1 parent dccd662 commit 96ad568
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It is based on the official REST APIs of these products, as well as additional p
(such as xml+rpc and raw HTTP requests).
This library can be used to automate tasks, integrate with other tools and systems,
and build custom applications that interact with Atlassian products.
It supports a wide range of Atlassian products, including Jira, Confluence, Bitbucket, and others,
It supports a wide range of Atlassian products, including Jira, Confluence, Bitbucket, StatusPage and others,
and is compatible with both Atlassian Server and Cloud instances.

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

.. code-block:: python
Expand Down
2 changes: 1 addition & 1 deletion atlassian/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.35.0
3.36.0
2 changes: 1 addition & 1 deletion atlassian/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .jira import Jira
from .marketplace import MarketPlace
from .portfolio import Portfolio
from .service_desk import ServiceDesk
from .service_desk import ServiceDesk as ServiceManagement
from .xray import Xray


Expand Down
4 changes: 2 additions & 2 deletions atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def get_child_pages(self, page_id):
"""
return self.get_page_child_by_type(page_id=page_id, type="page")

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

def get_page_by_title(self, space, title, start=0, limit=1, expand=None, type='page'):
def get_page_by_title(self, space, title, start=0, limit=1, expand=None, type="page"):
"""
Returns the first page on a piece of Content.
:param space: Space key
Expand Down
12 changes: 12 additions & 0 deletions atlassian/service_desk.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,18 @@ def get_sla_by_id(self, issue_id_or_key, sla_id):

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

def sla_rebuild(self, tickets=None):
"""
Fix corrupted or missing sla
https://confluence.atlassian.com/jirakb/missing-or-corrupted-sla-data-in-jira-service-management-828790603.html
:param tickets: list of tickets like [XXX-123, XXX-124]
:return:
"""
if tickets is None:
tickets = []
url = "rest/servicedesk/1/servicedesk/sla/admin/task/destructive/reconstruct"
return self.post(url, data=tickets)

# Approvals

def get_approvals(self, issue_id_or_key, start=0, limit=50):
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Utilities",
"Topic :: Internet",
"Topic :: Internet :: WWW/HTTP",
Expand Down

0 comments on commit 96ad568

Please sign in to comment.