Forums

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

"Fast-track transition an issue" post function for cloned issue, transition to In-Progress not worki

manjunatha.rajappa September 11, 2018

Hi,

We are using the below condition in the "Fast-track transition an issue"  post function(added in Open state). But it's not helping us TO DO Auto Transition of the cloned issue created from Open to In-Progress. We create a clone using More->Clone (in parent Issue) and once cloned issue created, cloned issue should auto transition to In-Progress.

Create -> Open -> In-Progress.

issueLinkManager.getOutwardLinks(issue.getId())*.issueLinkType.name.contains('Cloners')

Action: In-Progress

My cloned Issue looks as below:: This cloned issue, I need to auto transition to In-Progress.

Issue Links

clones

INT-31114 DVSI alarm being raised for Peak Number of

Issue linking is as below in my Jira instance::

Name: Cloners

Outward Description: clones

Inward Description: is cloned by

 

Even I tried with the below condition added:: issueLinkManager.getInwardLinks(issue.getId())*.issueLinkType.name.contains('Cloners')

- Manju

2 answers

1 accepted

0 votes
Answer accepted
manjunatha.rajappa September 24, 2018

The below condition helped me to handle this issue posted here. Thanks.

issue.summary.toString().contains("CLONE -")

0 votes
Elifcan Cakmak
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 11, 2018

Hello,

You can write a filter that searches for cloned issues and transition them with escalation service. Escalation service runs according to a cron expression that you define. For example you can check for cloned issues every 10 minute and transition them.

You can use built in features of escalation service (jql query, action) or write a script of your own and run it.

Selection_078.png

manjunatha.rajappa September 20, 2018

Hi Elifcan,

But I am looking for the approach to use the below script condition in "Fast-track transition an issue" using my script for 'Cloners' link type. Same is working for below Duplicate link type successfully. But it's not working for issueLinkManager.getInwardLinks(issue.getId())*.issueLinkType.name.contains('Cloners')

 Not getting the reason for this.....

issueLinkManager.getOutwardLinks(issue.getId())*.issueLinkType.name.contains('Duplicate')

Elifcan Cakmak
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 20, 2018

Hello,

I think it may be because of the usage of getInwardLinks. For getOutwardLinks you use source issue id for issue.getId() but for getInwardLinks you should be using destination issue id. 

https://docs.atlassian.com/software/jira/docs/api/7.1.4/com/atlassian/jira/issue/link/IssueLinkManager.html

I'm not sure how to implement this since we don't have the destination issue id. Maybe you can try with getOutwardLinks?

manjunatha.rajappa September 20, 2018

Thanks for your inputs. Even I tried with getOutwardLinks but no luck.

Other alternate way, I can handle my "Fast-track transition an issue" condition is: My cloned Jira issues summary always Append with "CLONE -" String as below. So if I can check this sub-string in Jira issue Summary using groovy script  - I can use this condition instead of Cloners Issue link type - Do have any suggestion on this alternate approach to add the same into "Fast-track transition an issue" condition???

CLONE - Gain DR Kit changes

- Manju

Elifcan Cakmak
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 20, 2018

I think that would be much harder. You need to fetch all the linked issues and check their summaries in a loop. 

Instead of that, you can check with a jql in a groovy script that if the issue has cloned issues and if the list is not empty, fast track the transition. Something like this:

def jqlSearch = '(issueFunction in linkedIssuesOf("issuekey = ' + issue + '", "is cloned by")) or (issueFunction in linkedIssuesOf("issuekey = ' + issue + '", "clones"))'
def parseResult = searchService.parseQuery(user, jqlSearch)
List issues = null

if (parseResult.isValid()) {
def searchResult = searchService.search(user, parseResult.getQuery(), PagerFilter.getUnlimitedFilter())
issues = searchResult.issues.collect {issueManager.getIssueObject(it.id)}
} else {
log.error("Invalid JQL: " + jqlSearch);
}
issues!=null

I haven't tested it as a condition but it may work.

Also let's try to get help from other people. @Nic Brough -Adaptavist- Could you give us some insight about the issue?

manjunatha.rajappa September 20, 2018

No, only for source issue I need to check the issue.summary== "CLONE -" substring. So that source issue(any cloned issue) will be auto transitioned to next state(In Progress from Open state directly) using fast track transition post function.

Elifcan Cakmak
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 20, 2018

Wouldn't it transition every issue that has CLONE substring in its summary in the project rather than only that issue's clones? Because there is nothing to check if it's the clone of the issue that you transition. As far as I understand fast track transition checks for that condition and apply the action and that's all. If the condition is to have CLONE substring it will transition all issues that have CLONE in it. 

manjunatha.rajappa September 21, 2018

When we do More->Clone on any parent Jira issue, new Clone issue (appended with "CLONE -" substring in our workflow, will start from 'New->Open' transition and In 'Open' State post function, will add the condition to check issue.summary== "CLONE -" substring i,e JQL sctipt, should transition only Clone PRs to In Progress directly.

 

But how to check this issue.summary== "CLONE -" substring condition using groovy to add into fast track transition condition to apply the action/In Progress state???

 

- Manju

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events