JSU Precondition to check linked issue exist or not with summary contain

Omprakash Thamsetty
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.
June 30, 2020

Hi,

I am using JSU jql precondition to find the existing linked issue exist or not with particular summary. If the issue exist then I will avoid creating duplicate ticket but what should I write in JQL query in JSU precondition to find the linked issue with particular summary.

 

JQL returning the details with but not working JSU precondition. 

issueFunction IN linkedIssuesOf("key=TEST-123",Milestone) and summary ~ "Test summary"

Any help much appreciate. 

 

Thanks,

Om

3 answers

1 accepted

0 votes
Answer accepted
Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 30, 2020

Hi, note that you cannot do any kind of "contains()" on JQL so,

{issue.summary} ~ "Test Summary" is not a valid clause.

 

You can do summary ~ "Test Summary" to find out if linked issues have "Test Summary" string or you can use summary ~ {issue.sumary} to search for linked issue having similar sumary that the transitioned issue which i supossed is what you was trying to achieve.

 

But you cannot compare two plain strings using ~ operator, first need to be an issue field name.

Alternatively, you can also use JQL Booster Pack app which also provides the linkedIssuesOf() function, in case Script Runner for Jira is not present yet on your system.

Omprakash Thamsetty
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.
June 30, 2020

@Jack Nolddor _Sweet Bananas_ 

 

is this correct

 

issueFunction IN linnkedissueof("key={issue.key}",Milestone) and "Test Summary" ~ {issue.summary}
Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 30, 2020

If "Test Summary" is a field name, then yes. If it is a regular string then no since you cannot compare two Strings on JQL you need to compare a String against an existing field (system or custom)

Omprakash Thamsetty
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.
June 30, 2020

Test Summary is not field name. It is summary . So I need to check linked issue has ABC summary or not. If it is there then I will ignore creating linked issues. So how I can write in JSU JQL to search ABC in linked summary?

Omprakash Thamsetty
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.
June 30, 2020
issueFunction IN linnkedissueof("key={issue.key}",Milestone) and summary ~ "Test Summary"

here Summary is sytem field  and Test summary is text in subject line of Linked issue. look like above query should work right? 

Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 30, 2020

Yep it looks better now,

1 vote
Partibha Rani July 2, 2020

Hi Om,

If you are using Scriptrunner as well, than Specified query:

issueFunction IN linkedissueof("key={issue.key}",Milestone) and summary ~ "Test Summary", looks good.

Without Scriptrunner, query will look like:

issue in linkedIssues({issue.key}, "Milestone") and summary ~ "Test Summary"

I hope this is of some help. If you need assistance, you can always raise a support ticket on the JSU support portal https://servicedesk-apps.beecom.ch/servicedesk/customer/portal/3

Thanks!

fabian_lim August 19, 2020

Thanks this worked like a charm.  

0 votes
Hasna June 30, 2020

Hi @Omprakash Thamsetty 

 

Could you please post the not working  query also

 

Hasna

Omprakash Thamsetty
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.
June 30, 2020

image.png

Omprakash Thamsetty
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.
June 30, 2020

@Hasna Please see above screen shot. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events