Does anyone know of a script of can assist in writing a script to run in a post transition to do the following?
Tickets have the "Assignee" and and a "Discipline" field. Have the "Discipline" field to be automatically set to a certain value based upon the role of the assignee of the ticket.
Community moderators have prevented the ability to post new answers.
If it's text, use this code
import com.googlecode.jsu.util.WorkflowUtils def sourceFieldName = "assignee" def targetFieldName = "customfield_10260" def assignee = WorkflowUtils.getFieldValueFromIssue(issue, WorkflowUtils.getFieldFromKey(sourceFieldName)) def targetField = WorkflowUtils.getFieldFromKey(targetFieldName) if(assignee = "person1") { WorkflowUtils.setFieldValue (issue, targetField, "value1") } if(assignee = "person2") { WorkflowUtils.setFieldValue (issue, targetField, "value2") } if(assignee = "person3") { WorkflowUtils.setFieldValue (issue, targetField, "value3") }
I think that may be a little out of date. You can use do
issue.assigneId = "bob"
Use some business logic to work out who "bob" should be as in the example above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is a start. So the custom field is a select list populated with all of the roles for the project. The script should pull the role for the assignee and then set the custom field value to the one that matches their role for the current issues project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Script Runner Plugin and this post may help you https://answers.atlassian.com/questions/95171/workflow-validator-for-current-assignee-is-in-projectrole
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, I have that.... but I am not a developer and do not know hwo to write the script that would do what i want above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What is the type of your custom field?
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.