How to update custom field value based on previous status

Kavya Janiwarad May 17, 2022

Hi Team,

 

How can we update a custom field value based on the previous status of an issue in the post function?

For example: Here the custom field is a select list single choice type, we have to update this field to a value "1" whenever it transitions from some X status.

Again need to update the field to value "2" if it transitioned from Y status via postfunction.

Let me know how to implement this.

 

Regards,

Kavya Janiwarda

2 answers

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.
May 17, 2022

Hi Kavya,

Maybe I am not understanding correctly, but you have a workflow that goes from Status X to another status, and you have a transition that goes from Status Y to the same status or another one? 

Why can't you just set a post function each transition to set the value of the field? 

0 votes
Florian PEREZ
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.
May 17, 2022

Hello, 

this can be quite hard to do. 

Once I did something with scriptrunner using the history of the issue. It was really hard to do and to be honnest it wasn't perfect. 

We finished by using a customfield to hold the value in an array that we dont show on ticket). It was very ugly but functional.

Hope this help

Suggest an answer

Log in or Sign up to answer