File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ from atlassian import Jira
2+
3+ JIRA_NODE_URL = "JIRA_NODES_1"
4+ JIRA_LOGIN = "admin"
5+ JIRA_PASSWD = "admin"
6+
7+
8+ class IndexFixer (Jira ):
9+ def deindex_issue (self , issue_id ):
10+ # own end point to deindex
11+ url = "deindexIssue.jsp"
12+ params = {"issueId" : issue_id }
13+ return self .get (url , params = params )
14+
15+
16+ s = IndexFixer (url = JIRA_NODE_URL , username = JIRA_LOGIN , password = JIRA_PASSWD )
17+ response = s .index_checker ()
18+ print (response )
19+ fixer = False
20+ index_orphant_issues_count = response ["indexOrphansCount" ]
21+ if index_orphant_issues_count > 0 :
22+ index_orphant_issues = response ["indexOrphans" ]
23+ for ticket in index_orphant_issues :
24+ ticket_id = ticket ["issueId" ]
25+ print ("Orphan index for ticket id = {}" .format (ticket_id ))
26+ if fixer :
27+ s .deindex_issue (ticket_id )
You can’t perform that action at this time.
0 commit comments