History of Values in a Custom Field

Krzysztof Kiser January 12, 2021

Hi,

I need to add a custom field that would store the history of values in another custom field.

 

Whenever a user transitions an issue to "Pending" they will update a custom field "Pending Reason" with the reason.
An issue can be transitioned to "Pending" multiple times, so I need to have a scripted field that would show all of the values that were ever entered in "Pending Reason" and the dates they were entered.

 

Is there any way I could accomplish this?

1 answer

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2021

Hi Krzysztof - I do not not of a way to do it other than creating multiple custom fields for each time it happens. Pending Reason, Pending Reason 2, etc. to the number 10 or whatever the max is that you think will happen. 

Same with a custom date field - Pending Date, Pending Date 2, etc. 

Or you can create a multiline text custom field and append to the values in that field every time it happens. 

Krzysztof Kiser January 12, 2021

I thought that since the changes are saved in history, there would be a way to pull them all out to a custom field.

As for the append approach, any ideas on how I could accomplish this?
I am guessing that using a groovy script would be an option, but I am not that familiar with scripting.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2021

You might be able to pull them out using the API somehow, but that is beyond me. 

For the append approach, create a multiline text custom field type. 

The create an Automation For Jira rule that when the status moves to Pending that the value of the Reason field and the current timestamp (Now) will but added to the field. 

So it is a rule with an Issue transitioned trigger

Condition for transitioned to Pending

New action - Edit issue

Select the new custom field

Then in the box for the update, use this code:

{{issue.custom field}} 

{{issue.pending reason}}   {{now.jiraDate}}

 

Use the actual names of the fields. 

Suggest an answer

Log in or Sign up to answer