Hi, I'm using Jira Cloud in a company-managed project and trying to calculate the progress percentage of parent issues based on the status of their child issues in Jira Automation.
Here's what I'm aiming to do:
Request payload:
headers
Accept: Application/JSON
Content-Type: Application/JSON
custom data
{"jql": "project=kdev and parent={{triggerissue.parent.key}}"}
or
{"jql": "project=kdev"}
Response payload:
{ "count": 0 } // count is always 0, response status is 200 = success
Even though I know there are issues that match the JQL query, the response count is always 0 when used in Jira Automation.
Has anyone successfully implemented this, or can provide guidance on how to get the correct count of child issues through Jira Automation?
Any help would be greatly appreciated!
Take a look at my response (to my own ticket actually :-) ) :
I had a similar issue getting 200 response so the API call was somehow quietly erroring. I resolved this in my case with the header "authorization" adding bearer. This is what I am using for authorisation. Hope this helps.
p.s. Have you got {{triggerissue.parent.key}} working in the body of "custom data".
|
@Stuart Wosika was right, the Authorization header was indeed the source of the problem.
Also, {{triggerissue.parent.key}} is working well. Here is my final custom data for two cases:
{"jql": "parent={{triggerIssue.parent.key}}"}
{"jql": "parent={{triggerIssue.parent.key}} and statusCategory=Done"}
One thing I’m curious about is why the response was 200 success. If the issue was related to authentication, shouldn't it have returned a 401 unauthorized instead?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Stuart Wosika! - What an unexpected thing! I imagine no auth token header is required if the rule actor has the proper access to browse the issues involved.
Or, I would expect the Jira Cloud API to respond properly if that authorization is required and not just a 0 count. Do you agree they need to enhance this endpoint? I bet so.
Thanks again for your addition to my response here!
- Pablo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @simonlee
Welcome to the community!
I was curious about your case and decided to take some tests. Unfortunately, I got the same results when using the /rest/api/2/search/approximate-count API endpoint.
It seems there is a problem when the request is sent through Automation for Jira, so I suspect the Custom data is not correctly sent over as the request's payload, and it always returns 0.
As you can see in the captures below, even when a specific issue key is sent as part of the JQL, the count remains 0. That would be absurd, knowing the issue exists.
When I try using the JMWE Nunjucks tester (and callJira filter to send the request), the response is OK, and the count is 1, as it should be. This confirms it's something specifically with A4J that's failing.
I would suggest opening a bug report with Atlassian. They should check why we have this inconsistency.
I'm afraid there is not much else we can do regarding this behavior.
- Pablo / SSE - ServiceRocket
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.