I want to have a label added automatically when an issue goes to a status of ready for development. I want to do this because my idea is to set up 2 separate boards for the project 1 for the PMs, leads, etc. and one specifically for the developers. The one for the developers would only show issues that have this label and therefore would only show issues that are actively being developed or are ready for development. Rather than needing to assign the issue to a developer, change the status, and add the label so it shows on the board I would like to automate as much of that process as I can getting it down to 2 actions or even one if I can.
Hello Isaac,
Welcome to Atlassian community!
Unfortunately, JIRA does not have any post functions to add labels once the issue is transitioned. We have a feature request to implement this functionality here:
- Ability to add and remove labels in Post Function to Workflow Transition
Feel free to vote and watch the suggestion to increase its priority and also receive notifications about any updates.
For now, there are some plugins you can use to get it implemented on JIRA Cloud or Server. Here are the most common options:
1 - Use Automation for JIRA and configure the following rule:
2 - Use Scriptrunner plugin and configure the following Script, as mentioned on this thread:
import com.atlassian.jira.ComponentManager import com.atlassian.jira.bc.issue.label.LabelService import com.atlassian.jira.bc.issue.label.LabelService.AddLabelValidationResult import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.security.JiraAuthenticationContext import com.opensymphony.user.User import org.apache.log4j.Category ComponentManager componentManager = ComponentManager.getInstance() CustomFieldManager customFieldManager = componentManager.getCustomFieldManager() JiraAuthenticationContext authenticationContext = componentManager.getJiraAuthenticationContext() User user = authenticationContext.getUser() LabelService labelService = ComponentManager.getComponentInstanceOfType(LabelService.class) MutableIssue myIssue = issue ["somelabel", "someotherlabel"].each {String labelName -> AddLabelValidationResult validationResult = labelService.validateAddLabel(user, myIssue.id, labelName) if (!validationResult.errorCollection.hasAnyErrors()) { labelService.addLabel(user, validationResult, false) } }
Let us know if this information helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.