Roll up story points to epic failing on JQL clause

Neil Wills
Contributor
August 30, 2021

 

The Lookup clause below is causing an error when the Epic titles contains spaces:

issuetype in (Story) and "Epic Link" = {{issue.epic name}}

Lookup issues
There was an error executing a search during custom value definition: .
Custom Smart Value JQL Search: "issuetype in (Story) and "Epic Link" = Testing Framework" - Error in the JQL Query: Expecting either 'OR' or 'AND' but got 'Testing'. (line 1, character 49)
The above error does not occur when the Epic Link and Name do not contain spaces:
Epic Name:  Test Framework [Creates error]
Epic Name:  TestFramework [When the epic name does not contain spaces this clause works, which naturally does not work as epic names will have spaces.]  I determined this by removing the spaces 'TestFramework' and the OR or AND error above goes away.

Capture.JPG

2 answers

1 accepted

0 votes
Answer accepted
Gareth Cantrell
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.
August 30, 2021

Hi @Neil Wills 

You can wrap the smart value in quotes  to cater for multi-word strings: “Epic Link” = “{{issue.epic name}}”

Neil Wills
Contributor
August 31, 2021

by adding quotes to “{{issue.epic name}}” does this cast the expression to a string?

Gareth Cantrell
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.
August 31, 2021

There is no casting involved. You are simply wrapping the output of the smart value in quotes so that the JQL is valid in the same way that a manual JQL query needs to have values with spaces quoted. 

0 votes
Bill Sheboy
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.
August 31, 2021

Hi @Neil Wills 

I believe that epic link is actually a key value, and just renders as the epic name in the user experience views.  Please try this instead for your JQL in the lookup issues action:

issueType IN (Story) AND "Epic Link" = {{issue.key}}

Best regards,
Bill

Neil Wills
Contributor
August 31, 2021

I'll experiment, I suspect the issue.key might not match "Epic Link" depending what the value of issue.key is.  I used the above solution also.

Bill Sheboy
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.
August 31, 2021

Gotcha, and...

  • Inside of the branch you showed, the {{issue}} will always be the epic, as that is the current context/scope
  • If also inside the branch, you wanted to access the story which fired the rule you would use {{triggerIssue}}
  • Once back outside the branch, {{issue}} would once again refer to the trigger issue (the story)
Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events