Created
December 14, 2016 10:24
-
-
Save sebkouba/31dd4ce74a388d34601bf246de057c92 to your computer and use it in GitHub Desktop.
Delete jira worklogs by one user on particular day
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from jira import JIRA | |
jira = JIRA(server="http://something.com/", basic_auth=('user', 'password')) | |
query = "worklogdate = 2016-11-30 and worklogauthor = vfprelea" | |
relevant_issues = jira.search_issues(query, maxResults=50) | |
while relevant_issues: | |
for issue in relevant_issues: | |
for worklog in jira.worklogs(issue): | |
if worklog.started.startswith("2016-11-30") and worklog.author.name == "vfprelea": | |
# print(issue.fields.summary) | |
print("Worklog started: " + worklog.started + " by: " + worklog.author.name) | |
worklog.delete(adjustEstimate="leave") | |
# if issues remain they are found here | |
relevant_issues = jira.search_issues(query, maxResults=50) | |
print("done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment