Trying to create a sprint completion report using Jira automation with calculated values for Added/Removed/Completed/Incomplete issue count and story points. On creating it using a manual trigger, the automation works perfect and email is getting triggered with all calculated values. But it doesn't work as expected using a sprint completed trigger. The automation is configured like below:
When: Sprint completed In <Board>
Then: Lookup issues Search for issues using JQL: issueFunction in addedAfterSprintStart(<Board ID>,'Sprint ABC')
And: Create variable Create smart value variable
Variable name: AddedIssues
Smart value: {{#lookupIssues}} <tr> <td>{{key}}</td> <td>{{summary}}</td> <td> {{"Story Points"}} </td></tr> {{/lookupIssues}}
And: Create variable Create smart value variable
Variable name: AddedStoryPoints
Smart value: {{lookupIssues."Story Points". sum}}
And: Create variable Create smart value variable
Variable name: AddedStoryCount
Smart value: {{lookupIssues.size}}
.... Similar lookup and variable creation for Completed/Removed/Incomplete
And: Send email
On using sprint completed trigger, the lookup issues section shows this info in the audit log:
HI @Bharathi
Where are you storing the board id and sprint name, when using sprint completed.
Are you storing these values in variables?
You would need to do this.
Hi @Marc -Devoteam-, I had created a variable for storing sprint id using {{sprint.id}}. Was unable to fetch the board id using a smart value. Using the variables/direct values for board ID and sprint name, the lookup issues search found no issues.
Edited to add: Created variables for Sprint and Board IDs and passed then through the lookup but the search resulted in no values.
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 @Bharathi
I have this information from Adaptavist (deveoper of scriptrunner) they confirm that the enhanced JQL functions can only be run on the enhanced search page and not in native JQL due to how the JQL functions are run.
To use it in automation, you can reference the Jira filter anywhere where you have native JQL using the JQL query of filter = "<name of saved filter>"
This will allow you to use the results of the enhanced search filter inside a Jira automation or the script console to run the actions you need to run.
So you can't use the JQL features offer by scriptrunner directly in an automation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bharathi
Can u paste a photo of the audit log. We don't have access in your instance, Also this is a public forum so its better not to post links from your instance. (i will reduct it from the post)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reduction. Missed to notice the link. Adding a screenshot of the audit log including variables for board & sprint ID.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Bharathi
Thanks for the pic. My guess is that the ScriptRunner’s Enhanced Search functions like issueFunction in addedAfterSprintStart don't work reliably inside Jira automation, im not sure though. i tagged the post scriptrunner so that someone from the dcriptrunner team to see it. Also i believe u can make the whole thing in scriptrunner and not in automation and it should work.
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.