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

This widget could not be displayed.

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.

This widget could not be displayed.

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.

This widget could not be displayed.

Thank you!

We did it :)

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

99 views 1 0
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