Try this:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.Issue CF_Approver= ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Approver") def env = issue.getEnvironment() if (env.equals("SQA")){ issue.setCustomFieldValue(CF_Approver, "US-RM-AFL-Sqa") }
I just did that by using my cel, if any thing doesn't went good, let me know.
Field Name : Environment Field Name : Approver I need to get the value of "Environment" feild and compare it with the string value "SQA". based on that comparison I need to assing the string value "US-RM-AFL-Sqa" to Approver field. Please give me the exact code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok sir... sec
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm considering that "Approver" field is a custom field. Check my answer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It works? please accept my answer.
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.