Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Update custom field every time another field is updated

Christopher Gronde January 23, 2017

What I am trying to do is Create a custom field like "Due Date Extended" and everytime the DueDate field is edited, it then increases the value of the custom field by +1.  That way we can quickly see how many times a due date on any given ticket has been extended?.  I'm assuming this must be done as a script listener in ScriptRunner.  I've seen how to do the same type of thing on a postfunction, but not never on "updating/editing a field". 

 

JIRA 7.1.2

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Vasiliy Zverev
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.
January 23, 2017

It seems that you can use scripted field to get count of duedate chages. 

Code for this:

import com.atlassian.jira.component.ComponentAccessor

return ComponentAccessor.getChangeHistoryManager().getChangeItemsForField(issue,"dueDate").size()
Christopher Gronde January 24, 2017

Thanks!  I've never used a script field.  This is great information to know I can do this easier than I thought I could.

KRC February 15, 2018

@VasiliyZ

I have a similar thing to achieve but little different.

I am currently copying parent issue summary and issue description to custom fields in its subtask named parent summary and parent description. Am doing this with copy custom field post function. 

Now whenever parent issue summary and/or issue description is edited, we want those changes to flow thru and reflect in custom fields in subtask. How to get this done?

any you help?

Thanks

Vasiliy Zverev
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.
February 15, 2018

KRC,

You should use a listener on issueUpdated event.

Best regards,

Vasiliy

TAGS
AUG Leaders

Atlassian Community Events