Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how can we know whether duedate is changed or not for the ticket or issue ?? in python.

lavanya
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 3, 2019
if issue.fields.duedate is not None:
changelog = issue.changelog
for history in changelog.histories:
for item in history.items:
if item.field == 'duedate':
print('Date:' + history.created)

example: when issue was created, duedate is '12-09-2019' but someone or the other changed to '18-09-2019'
how to know whether duedate has changed from original duedate or not??

1 answer

0 votes
Tuncay Senturk _Snapbytes_
Community Champion
October 6, 2019

Hi @lavanya 

I do not python but below code might help you.

changeHistoryManager = ComponentAccessor.getChangeHistoryManager()
duedateChanges = changeHistoryManager
.getChangeItemsForField(issue, "duedate")

You can get dueDate field changes and check whether there is at least one change.

I hope I was helpful

Tuncay Senturk

Suggest an answer

Log in or Sign up to answer