Hi, I have an issue where the Create Sub-task postfunction does not reopen the same same Sub-Task yet continues to re-produce new Sub-Tasks? Please advise?
Workflow:
Main Task -> Create -> In Progress -> Request Approval -> Implementation
Subtask -> Create -> Open -> Option 1: Approve -> Closed -> Reopen -> Open
Subtask -> Create -> Open -> Option 2: Decline -> Closed -> Reopen -> Open
On ST:Approve transition MT to Implementation
On ST:Decline transition MT to In Progress
On Request Approval Creates ST (Even when ST already exists? We want to Reopen the existing ST instead of always creating new)
Additional code on Request Approval -> Post Function -> Create ST:
import com.atlassian.jira.ComponentManager import com.atlassian.jira.project.Project import com.atlassian.jira.project.ProjectManager import com.atlassian.jira.security.roles.ProjectRole import com.atlassian.jira.security.roles.ProjectRoleActors import com.atlassian.jira.security.roles.ProjectRoleManager ComponentManager componentManager = ComponentManager.getInstance() ProjectManager projectManager = componentManager.getProjectManager() ProjectRoleManager projectRoleManager = ComponentManager.getComponentInstanceOfType(ProjectRoleManager.class) as ProjectRoleManager def projectRole =projectRoleManager.getProjectRole("Approvers") def actors =projectRoleManager.getProjectRoleActors(projectRole, issue.getProjectObject()) def approver =projectRoleManager.getProjectRoleActors(projectRole, issue.getProjectObject()).roleActors.find { true } def issueEmergency =customFieldManager.getCustomFieldObject('customfield_12601') def issueSummary =issue.getSummary() def issuePriority =issue.getPriorityObject() emergencyValue =issue.getCustomFieldValue(issueEmergency).getValue() newSummary ="(" + emergencyValue + ") " + issueSummary + " - approval task." oldSummary =issueSummary + " - approval task." if(emergencyValue.equals("Emergency")){ issue.setPriorityId("1") issue.setSummary(newSummary) issue.setAssignee(approver.user) } else{ issue.setSummary(oldSummary) issue.setAssignee(approver.user) }
IS THERE ANYTHING PREVENTING REOPEN OF ST?
Community moderators have prevented the ability to post new answers.
Reopening a subtask looks for one with the specified summary, so won't work if you change the summary in the additional code.
Is there a work around to this Jamie?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Other than to just write your own script, I can't think of one.
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.