Date set information for custom field

MEDITECH ADMIN TEAM January 28, 2015

We are trying to figure out a way to know/get the date a custom field gets set for reporting purposes.  For example, we have a Yes/No select list field that gets set after an issue gets created.  Is there any way to get the date this was set internally?  If not, can we get the information we are looking for a different way?  Our only other way around this is to change the field to a date field and have the user enter in the date they set the field but we don't like this option. 

3 answers

0 votes
Volodymyr Krupach
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 28, 2015

I believe you can do it by adding one more "Date" custom field to the same screen where you have "Yes/No" and injecting JavaScript that will populate the date field when a "Yes/No" is changed.

Sample of adding JavaScript to a custom field: https://confluence.atlassian.com/display/JIRAKB/How+to+display+a+Field+based+on+another+Field%27s+selection

0 votes
Udo Brand
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 28, 2015

I think you have two possibilities:

When you create an issue (status Open) you could add a transition from Open to Open. In this transition you use a screen with this select list (remove it from edit screen) . Now you can set a custom date (time) field and populate it with the current date (time) in the postfunction of that transition.

The other is to use a scripted field (script runner) similar to this example:

https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+Fields#ScriptedFields-Showthedateaparticulartransitionfirsthappenedtothisissue

Since I'm not an scripting expert, I can't give you the correct script, but maybe others can help.

0 votes
Boris Berenberg
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 28, 2015

The value can be seen in the history portion of a ticket.

You can also do stuff like this in jql to get a list of issues:

project = blah blah and customfield changed after startofweek()

However, you can't query for the values directly. Though you could do that in the JIRA DB by looking at the changegroup, changeitem, and jiraissue tables. jiraissue is a list of issues. changegroup is a single change operation that occurs. changeitem is a single item that is changed as part of a group.

For example, if I update 3 different custom fields, I will get 1 changegroup, and 3 changeitem entries.

Udo Brand
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 28, 2015

Changed operator can only be used with Assignee, Status, Resolution,Reporter, FixVersion and Priority but not with custom fields (at least at the moment).

Suggest an answer

Log in or Sign up to answer