Hello Community,
Please advise or help me. Its server instance of jira. I have scriptrunner and JMWE plugins. I am working on a workflow of a story. Workflow has Start, Status B, Status C, Status D, Status E and Completed.
Problem :
My story has a customfield : Test Analyst ( Single Line Text Field) and its in Status B in workflow transition. If Test Analyst field has been populated with analyst's name then story's view screen should shows Status E transition button, mean to story will transition to Status E from Status B.
If Test Analyst field has not been populated with analyst name then story view should show Status C transition button. mean to story will transition to Status C from Status B.
Please advise me how to accomplish this task.
Thank you so much.
Regards,
Anupam
Are you on server or cloud. You can use Script Conditions to check for a specific field value. It can also be done with JMWE. I explained how to achieve this here, the example I used was to build an approval system and show transitions only when a condition is met.
You can do something similar on cloud as well but the main idea is to use Conditions.
I hope it helps.
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
with JMWE, you can use a Build-your-own Condition on both transitions (B to E and B to C). For transition to E, use this script:
issue.customfield_12345 != null
and for transition to C, use this script:
issue.customfield_12345 == null
Note that customfield_12345 needs to be replaced with the field ID of your "Test Analyst" custom field, which you can find on the "Issue Fields" help tab of the editor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @David Fischer ,
I am checking the value of Label and hiding/ displaying the transition. It works fine if Label field is not empty. But When Label is Empty It does not work.
for (label in issue.get("labels"))
if (label.getLabel()!="CX" )
{
return true
}
return false
Transition 'x' will be hidden even if Label is empty. How to check for empty value in label
Thanks
Madhura
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Anupam Sinha You can do it easily with the help of Simple Scripted Condition which is a part of Script Runner and put this condition :- cfValues['Some Custom Field'] == 'Some Value'
As you have mentioned it's a single line text field, value is not constant in this case. Condition might fail sometime if Agent name is not correct or some spelling mistake while typing agent name in a field.
It's better to use User Picker if this field is for Analyst name or use Select List instead of Single line text field for Analyst name.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.