Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Transition Required Linked Issue with specified Linked Description

David Harkins
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 30, 2021

Currently improving out Incident Workflow and we are over zealous on our alerts so we do get duplicate issues sometimes.

To simplify the workflow, from the 1st New status to the Last Closed status we are implementing a 'Duplicate' transition.  This automatically sets the resolution to 'Duplicate' and presents a screen for adding linked issues.

The Linked issue filed currently shows all Linked description, it would be ideal if we could ensure that only 'the 'Duplicates' description is pre-selected and the only option on that screen.

Also need to ensure that a valid issue has been specified.

2 answers

1 accepted

0 votes
Answer accepted
David Harkins
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 1, 2021

Added the following behavior on a 'Duplicate' Transition

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkTypeManager
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import org.apache.log4j.Logger
import org.apache.log4j.Level
import groovy.transform.BaseScript

@BaseScript FieldBehaviours fieldBehaviours
def log = Logger.getLogger(getClass())
log.setLevel(Level.DEBUG)

FormField linkTypes = getFieldById("issuelinks-linktype")

def allowedOutwardTypes = ["Duplicates"]
def allowedInwardTypes = []

IssueLinkTypeManager issueLinkTypeManager = ComponentAccessor.getComponent(IssueLinkTypeManager)

Map outwardAllowedLinks = issueLinkTypeManager.getIssueLinkTypes(false).findAll{ it.outward in allowedOutwardTypes }.collectEntries{
[it.outward,it.outward]
}
Map inwardAllowedLinks = issueLinkTypeManager.getIssueLinkTypes(false).findAll{ it.inward in allowedInwardTypes }.collectEntries{
[it.inward,it.inward]
}

def allowedLinks = outwardAllowedLinks << inwardAllowedLinks

log.debug("Allowed Links = $allowedLinks")

linkTypes.setFieldOptions(allowedLinks)
Igal Schwartzman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 17, 2022

is it available only with "Script Runner"? 
where should I add this script, in the script runner validators ?

David Harkins
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 24, 2022

@Igal Schwartzman 

You would need to add this as a behavior for the required workflow transition.

 Behaviours are configured within the Script Runner configuration screens.

1 vote
Fabian Lim
Community Champion
September 30, 2021

Hi @David Harkins

Out of the box this functionality is not available. you will have to use a script plugin such as power scripts or scriptrunner to limit the issue link options in the transition screen.

Another option is to use extended schemes: https://marketplace.atlassian.com/apps/1214172/extended-schemes-for-jira?hosting=server&tab=overview

But this would restrict at the issue type level so that limited options will show per issue type resolutions.

Regards 

David Harkins
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 30, 2021

Scriptrunner scripts would be the best option :-)

Just trying to work out the best way to achieve it .

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events