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

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

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.

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.

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.

Thank you!

We did it :)

Hi Valeriya,

Glad to help.

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

25,661 views 2 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you