Hi I have three sub-task issue types that share the same workflow and only one of the three requires a custom field.
I do not want to create a separate workflow but instead want to trigger a field requirement from the workflow they are sharing by using custom script.
issue.issueType.name == 'Storybug' && !issue.get("customfield_XXXXX")?.value did not seem to work. What am i missing. Is it even possible to do this in the workflow?
Hi Christopher,
You can simply create multiple transitions and add a condition for the separate issue types. Then in the one where it is required, add a Field Required validator.
Even though I provided an answer, I'm voting for this one, as it's one that I use in multiple workflows. I'm not sure why my brain didn't go to the solution that I've already implemented, but....
I do think you need to have the JSU plugin for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Christopher Kim ,
You accomplish your requirement using the Jira Misc Workflow Extensions (JMWE) app, please follow these steps
Add Field Required Validator(JMWE): For more details on adding this validator, please refer to the following link: https://appfire.atlassian.net/wiki/spaces/JMWEC/pages/465242701/Field+Required+Validator:
You can add a condition validator with simple Jira Expression which validates if the issue type is "story bug".
issue.issueType.name == "Storybug"
Hope it helps!
Thanks,
Teja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christopher,
I can confirm in Jira Cloud you can use the Workflow validators feature provided by Scriptrunner for Jira Cloud.
Workflow validators use the Jira Expression framework provided by Atlassian, and you will need to use these to create the conditions you require.
I can confirm we have an example on line 76 here which shows how to allow a specific type of subtask to be created when a custom select list field has a value and this will help act as a guide to help create the expression that you require.
I hope this helps,
regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not as familiar with Cloud, but in Data Center, if you have the Scriptrunner plugin, you can use the 'Field(s) required validator' on the transition and make the field required, but add in a condition that the issue in transition has to have a specific issue type.
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.