I am trying to use the linkedissues() function within a Jira Automation, but I am getting an unexpected error.
The following JQL query works fine in an advanced search:
issue = PROJ-154 AND issue in linkedissues(PROJ-155)
With the automation with a JQL match If condition where issueToLink is an issue found in the comments.
issue = {{issue.key}} AND issue in linkedissues({{issueToLink}})
I get the error:
No subsequent actions were performed since JQL condition did not pass due to error running JQL:"(key IN (PROJ-164) AND (issue = PROJ-164 AND issue in linkedissues(PROJ-154, PROJ-154)))" - Issue link type 'PROJ-154' could not be found in function 'linkedIssues'.
I want to match all linked tickets. If I use issue = {{issue.key}} AND issue in linkedissues({{issueToLink}}, "relates to"), it works fine, but I want to match any linked tickets that match the key.
Is this a Jira automation bug, or am I using it wrong?
Note:
It looks like a bug might have been introduced on 9/20/2020, as linkedissues function worked in automation with a single parameter for me earlier that day and started failing past 9PM PST that day, unless someone changed the trigger on me.
I'd previously thought I successfully tested and rolled out a trigger using this query:
Turns out that when match() returns a collection, the smartvalue shows up a comma separated list. The confusion stemmed from the fact that the error only appeared when the user pasted a full on link into the comments (where issueToLink was attempting to look for issue keys). This introduced smartlink tags that didn't show up in the rest api and wasn't obvious in the JIRA UI, only if comment.body was printed out as a smartvalue. The regex was matching PROJ-154 twice from the comment text
[https://mycompany.atlassian.net/browse/PROJ-154|https://mycompany.atlassian.net/browse/PROJ-154|smart-link]
The fix to my issue was to handle both cases where issueToLink may be a string such as PROJ-154 or a string or a comma separated list of values, where I split and take the first match.
Hi Henry,
Yes, I think I remember that bug of only one parameter being allowed. So you could do an if then and list each of the issue link types as a separate action - assuming there are not too many.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi folks,
I don't know much at all about this function since its a Jira specific thing. However, looking at the error message:
Issue link type 'PROJ-154' could not be found in function 'linkedIssues'.
I think the issue might be with your param. Why is issueToLink smart value providing the same value twice? In your example you only had it once. I'd start with that and see if that helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I troubleshooted with support and the smart value was properly set. However while we were adding logs, the issue stopped manifesting. The fact the error message was telling me that that my key was being passed in twice with a comma in between to simulate two params made no sense based on the code that created the issueToLink variable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.