How to change custom field "QA Status" value during the Reopen transition using Jira behaviours

Valeriya Petrukhina May 29, 2014

Hi,

I've got custom field "QA Status" with values QA verified, QA pending, QA not needed

And I need to automatically set this field to "QA pending" if it is in "QA verified" when issue is reopened.

I try to use something like this:

FormField QAStatus = getFieldByName ("QA Status")

String QAStatusVal = QAStatus.getFormValue()

if(QAStatusVal == "QA verified")

QAStatus.setFormValue ("QA pending")

and

FormField QAStatus = getFieldById ("customFieldId=10800")

String QAStatusVal = (String) QAStatus.getValue()

if(QAStatusVal == "QA verified")

QAStatus.setValue ("QA pending")

But nothing is working for me.

I'm a new one in Behaviours. Please, help.

Thank you!

4 answers

0 votes
Haizelyn Casimiro June 3, 2014

Hi Valeriya,

Glad to help.

Could you pls. tag this as the best answer to your question if this really helped. Thank you. :)

0 votes
Valeriya Petrukhina June 2, 2014

Thank you!

We did it :)

0 votes
Haizelyn Casimiro June 2, 2014

You could add a Condition to your transition for Reopen (the one with the post function for setting the custom field "QA Status" value to "QA Pending") that it can only be clicked if the value of the custom field is "QA Verified" with the ff. settings :

1. Choose the "Value Field"

2. Field: QA Status

Condition: =

Value: QA verified

Comparison Type: String

Then you could add another transition that will reopen your issue but will not change the custom field "QA Status" value to "QA Pending" with the Condition that this will only be shown if the value of your custom field "QA Status" is not equal to "QA Verified"

1. Choose the "Value Field"

2. Field: QA Status

Condition: !=

Value: QA verified

Comparison Type: String

Since only one transition will be shown you can now reopen an issue and enact your desired post function depending on the custom field "QA Status" 's value.

Regards.

0 votes
Haizelyn Casimiro May 30, 2014

Hello Valeriya,

You could automatically set the value of your custom field "QA Status" to "QA pending" by adding a post function to the transition that will reopen your issue.

This way, everytime the transition for reopen is clicked, the custom field value will be changed to "QA pending".

Hope this helps.

Valeriya Petrukhina June 1, 2014

Thank you!

But this could help if only I just need to chenge status on current transition, but before changing it, I need to check current status and if it is "QA verified" then set it to "QA pending". If it wasn't set to "QA verified" (we have 5 more variants) then I don't need to change it.

Suggest an answer

Log in or Sign up to answer