Forums

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

Log change of DueDate field in customfield DueDate_LastUpdated

Bernd Anderer
Contributor
October 23, 2018

Every time a user makes a change in the DueDate field I want to record the current Date/Time in a separate customfield called DueDate_Lastupdated.

This is not based on a workflow event so I guess the function has to be part of the DueDate field - yet I can not find any clue on how to do that.

I do have Scriptrunner available but so far I only found ways that don't work ;-)

Scriptrunner: 5.4.28

Jira: 7.12.1

Any idea on how to solve this issue?

Thanks in advance,
Bernd

1 answer

1 accepted

0 votes
Answer accepted
Joshua Yamdogo @ Adaptavist
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 25, 2018

Answered through our support portal:

import com.atlassian.jira.component.ComponentAccessor

def changeHistoryManager = ComponentAccessor.changeHistoryManager
def currentStatusName = issue?.status?.name
def item = changeHistoryManager.getChangeItemsForField (issue, "duedate").reverse().first()
return new Date(item.created.getTime())
Bernd Anderer
Contributor
October 25, 2018

Joshua Yamdogo @ Adaptavist Thank you for the script!

Suggest an answer

Log in or Sign up to answer