hi, I am using select list(cascading) type custom field to trigger the script below. I only want it to validate the first field value. I only want Mpower - MOBILE and Mpower - WEB as my trigger, but when I included 2nd value, it is not creating subtask.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import org.apache.log4j.Logger
import org.apache.log4j.Level
def cf_name = customFieldManager.getCustomFieldObjectByName('Product (New)') as String
def x = issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Product (New)")) as String
if(
x in ["[null:Mpower - WEB, 1:PowerForm - 3.3.3]",
"[null:Mpower - WEB, 1:PowerForm - 3.3.2]",
"[null:Mpower - MOBILE, 1:WorkForce - 1.10.17]",
"[null:Mpower - WEB]",
"[null:Mpower - MOBILE]"] && issue.getSubTaskObjects().size()==0)
{
return x
}
the 2nd field is the version, and there are atleast 35 of it. if I included it on the the script, and there's a new release, I will need to update it.
any work around?
Hi Chax,
How are you using this script? For example, are you using it in Behaviour, a Post Function, etc?
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.