Hi all,
I have found a way through a grovvy script to make sure when the close with resolution = duplicate that they have an issue linked with outward as duplicate.
The problem I am having is that the user can still link an issue as duplicate, and it not be closed.
To do this I go into "More" => Link, and then link as duplicate.
My user wants to only be able to link as duplicate when closing as duplicate. Is that possible?
Here is my verification script that works on the close transition
linkCnt = 0
request = webwork.action.ActionContext.getRequest()
if (request) {
// check for new duplicates link
linktype = request.getParameter('issuelinks-linktype')
linkedIssue = request.getParameter('issuelinks-issues')
if (linktype == 'duplicates' && linkedIssue) linkCnt = 1
}
// check for existing duplicates link
if ( issueLinkManager.getOutwardLinks(issue.getId())*.issueLinkType.name.contains('Duplicate') ) linkCnt += 1
// Transition requires one, and only one, duplicates link or the resolution not to be Duplicate
(linkCnt==1) || cfValues['resolution'].toString() != 'Duplicate' :