Skip to content

Commit a33822e

Browse files
authored
Jira duplicated accounts checker (#1401)
* Add duplicated account detection method * Review import libs
1 parent 928c899 commit a33822e

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ jobs:
3333
uses: codecov/codecov-action@v4
3434
with:
3535
files: ./coverage.xml
36-
fail_ci_if_error: true
36+
fail_ci_if_error: false
3737
token: ${{ secrets.CODECOV_TOKEN }}

atlassian/jira.py

+31
Original file line numberDiff line numberDiff line change
@@ -5327,3 +5327,34 @@ def health_check(self):
53275327
# check as support tools
53285328
response = self.get("rest/supportHealthCheck/1.0/check/")
53295329
return response
5330+
5331+
def duplicated_account_checks_detail(self):
5332+
"""
5333+
Health check: Duplicate user accounts detail
5334+
https://confluence.atlassian.com/jirakb/health-check-duplicate-user-accounts-1063554355.html
5335+
:return:
5336+
"""
5337+
response = self.get("rest/api/2/user/duplicated/list")
5338+
return response
5339+
5340+
def duplicated_account_checks_flush(self):
5341+
"""
5342+
Health check: Duplicate user accounts by flush
5343+
The responses returned by the count and list methods are stored in the duplicate users cache for 10 minutes.
5344+
The cache is flushed automatically every time a directory
5345+
is added, deleted, enabled, disabled, reordered, or synchronized.
5346+
https://confluence.atlassian.com/jirakb/health-check-duplicate-user-accounts-1063554355.html
5347+
:return:
5348+
"""
5349+
params = {"flush": "true"}
5350+
response = self.get("rest/api/2/user/duplicated/list", params=params)
5351+
return response
5352+
5353+
def duplicated_account_checks_count(self):
5354+
"""
5355+
Health check: Duplicate user accounts count
5356+
https://confluence.atlassian.com/jirakb/health-check-duplicate-user-accounts-1063554355.html
5357+
:return:
5358+
"""
5359+
response = self.get("rest/api/2/user/duplicated/count")
5360+
return response

docs/jira.rst

+16
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,22 @@ Cluster methods (only for DC edition)
588588
# Request current index from node (the request is processed asynchronously).
589589
jira.request_current_index_from_node(node_id)
590590
591+
Health checks methods (only for on-prem edition)
592+
------------------------------------------------
593+
.. code-block:: python
594+
595+
# Get health status of Jira.
596+
jira.health_check()
597+
598+
# Health check: Duplicate user accounts detail
599+
jira.duplicated_account_checks_detail()
600+
601+
# Health check: Duplicate user accounts by flush
602+
jira.duplicated_account_checks_flush()
603+
604+
# Health check: Duplicate user accounts count
605+
jira.duplicated_account_checks_count()
606+
591607
TEMPO
592608
----------------------
593609
.. code-block:: python

0 commit comments

Comments
 (0)