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

Can I auto-update a custom date field when another custom field is updated?

Matt Parks April 24, 2015

I have a custom text-field that contains the status of a particular ticket. When this field is updated, I would like to have another custom date field automatically updated so it is possible to filter on all tickets where the field hasn't been updated in certain timeframe.

 

Is it possible to do this? I know it can be done with the Last Updated date, but I don't want to know when the ticket itself was last updated, just this particular field.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Kerem Caglar [Solveka]
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.
April 24, 2015

What you can do is:

  • Implement a custom listener for ISSUE_UPDATED event
  • You need to detect if your custom field is changed. For this you have to use issueEvent.getChangeLog()
changeItems = issueEvent.getChangeLog().getRelated("ChildChangeItem");
for(GenericValue gv: changeItems){
	String changedFieldKey = gv.getAllFields().get("field").toString();
	String changedFieldType = gv.getAllFields().get("fieldtype").toString();
......
}
  • Then you need set the value for the custom date field.

 

 

0 votes
Dmitrii Apanasevich
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.
April 24, 2015

Hi!

You could update auxiliary custom field at the moment of issue update via event listener: https://developer.atlassian.com/jiradev/jira-platform/other/tutorial-writing-jira-event-listeners-with-the-atlassian-event-library

Just check that your text field has been updated.

TAGS
AUG Leaders

Atlassian Community Events