Hi everyone,
I have a situation with transitioning the original issue from cloned issues. Here is the situation:
The original issue may have one clone or more. For example I have a bug in my project but it affects a product line as well. In this case there will be a product line clone. Developers will fix this bug on the product line clone. When the bug is resolved, I want my original issue's status as resolved automatically. I implemented this to my jira instance.
But the problem is that there may be more than one product line clone. How am I suppose to block this automatic transition if there are more than one clone?
By the way, I have JSU, JMWE and Scriptrunner plugin installed on my jira(v_8.7) instance.
@Sümeye Beki , you can use the scripted listener and try something similar like the below code which will transition your original issue only when your all cloned issues are fixed/closed
def x =
ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId())?.findAll {it.issueLinkType.outward == "Cloners"}*.destinationObject?.findAll { it.status.statusCategory.name != "Complete" }
if(x.size()==0)
{
JiraWorkflow workFlow = ComponentAccessor.getWorkflowManager().getWorkflow(issue);
com.opensymphony.workflow.loader.StepDescriptor currentStep = workFlow.getLinkedStep(issue.getStatus());
List<ActionDescriptor> actions = currentStep.getActions();
for(ActionDescriptor action : actions)
{
if(action.getId() == <id>)
{
boolean result = false;
IssueService issueService = ComponentAccessor.getIssueService();
IssueService.IssueResult transResult;
IssueInputParameters issueInputParameters = new IssueInputParametersImpl();
TransitionValidationResult validationResult = issueService.validateTransition(user, issue.getId(), action.getId(), issueInputParameters);
result = validationResult.isValid();
if(result)
{
transResult = issueService.transition(user, validationResult);
}
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.