Hi Team,
Our team needs assistance automatically populating the "Issue Type" field with the value from a "custom field." Can this be achieved using Script Runner, JMWE, and JSU add-ons?
Hi Lakshmi - I believe this will only be possible using the ScriptRunner Behaviours app.
Hi @John Funk
Do you happen to have any sample code available?
Sorry I don't as I don't actually use the tool.
Hi @jira_admin_cu.
Yes, it is possible to do it using Scriptrunner.
At first, you need to configure a behaviour that executes when you update the custom field.
Inside the behaviour, you can use the following lines to make your script works:
import static com.atlassian.jira.issue.IssueFieldConstants.ISSUE_TYPE // Get all the issue types availabledef allIssueTypes = ComponentAccessor.constantsManager.allIssueTypeObjects//Get the issue Type Fielddef issueTypeField = getFieldById(IssueFieldConstants.ISSUE_TYPE)//You need to obtain the value of the custom field, and find the correct //Issue type that you want to add//Update the Issue Type value.issueTypeField.setFieldOptions(<your variable with the proper issue type>)
It looks like you're new here. Sign in or register to get started.