Counting of issues with {{lookupIssues.size}} does not work

Iris Studeny September 6, 2022

Hello Atlassian Community!

I have a question regarding to the function {{lookupIssues.size}}. With that function we want to count our linked issues.

Our use case is that smartphones get linked to a purchase order and with our field "Cycle Count" we would like to see how often the smartphones were linked. 

But now this seems to not work, even though no error is shown in the audit logs. 

We created following automation: 

Automation.PNGCycle Count function.PNGMaybe someone can help us with our problem.

I look forward to hearing from anyone.

 

P.S. If further information would be needed, please feel free to ask and comment.

 

Thank you in advance.

 

With best regards,

Iris Studeny

3 answers

0 votes
Melissa C January 22, 2024

Hello Everyone & @Iris Studeny 

Is there an update to this?
I'm also looking to get a count of all the Tasks in an Epic. 

I'm using Jira Server and testing with 9.0, which has the lookup feature. 
{{Issues.Size} give me the count of Epics in my Query not the count of Tasks.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 24, 2024

Hello @Melissa C 

Please provide the details of your query/automation. Your query doesn't sound the same as the original poster. You should be able to get the list of tasks under the epic with this JQL in your Lookup Issues action.

"Epic Link" = <Epic issue key> and issuetype=Task

Melissa C January 29, 2024

@Trudy Claspill Thanks for the reply

let me elaborate on what I'm trying to accomplish and perhaps you can give me some suggestions. 

I want to get the number of Task in each Epic.  The idea is that I would send a weekly report stating the following Epic have been approved but still have X number of Tasks open. 

When I use the {{Issues.Size}} it gives me the number of Epics in my query Not the number of Tasks in each Epic. 

Does that make sense?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 29, 2024

Hello @Melissa C 

{{Issues.size}} is not the same smart value as {{lookupIssues.size}}, so that is the first thing that needs to be cleared up through our ability to examine your rule.

Second, {{lookupIssues.size}} indeed will give you the count of issues returned by the query in your Lookup Issues action. It can't be used to get the count of issues related to the ones returned by your query.

 

Given that your question concerns Epic and child issues, not linked issues like the original question, I recommend that you start a new Questions post.

In your new post please provide screen images to show your entire automation rule and the details of each step. Without that information it is difficult to debug your situation and our suggestions will be educated guesses at best.

 

0 votes
Evan Reeves October 4, 2022

@Trudy Claspillis it possible that the automation does not have access to the project? I was just able to get this working after I changed the scope of the JQL query. The automation did not have access to the project being used in the JQL query.

When I changed this to the project it did have access to I was able to get the count correctly via the {{lookupIssues.size}} smart value.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 4, 2022

Hello @Evan Reeves 

Yes, that is a possibility.

Each Automation Rule has an Actor setting which specifies the identity under which that rule will run. The specified Actor needs to have appropriate permissions in the target project(s) to execute the actions specified in the Rule.

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 6, 2022

Hello @Iris Studeny 

Welcome to the community.

In what way exactly is this not working? Are you not getting the value you expect from {{lookupIssues.size}} ?

Have you used the JQL you have in the Lookup Issues action in the Advanced Issue Search screen to confirm that it is actually finding any matching issues? Of course, you will need to substitute the actual issue key value for the smart value when you do that.

Iris Studeny September 6, 2022

Hello @Trudy Claspill 

Thank you for your reply.

 

Yes that is exactly our problem: We do not get the expected value of it. For example, there are two linked issues and it gives us 0. 

No we did not try your hint, should we?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 7, 2022

Hello @Iris Studeny 

Yes, you need to try that.

It is highly probably that your JQL is not finding any matching issues and that lookupIssues.size is giving the correct data.

Iris Studeny September 8, 2022

Hello @Trudy Claspill 

Ok so you mean to give our following JQL in the search field: issue in linkedIssues({{issue.key}}) and issueLinkType = "has active Hardware assigned" 

 

Thank you in advance!

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 8, 2022

You will have to replace {{issue.key}} with the ID of an actual issue that triggered the rule.

Iris Studeny September 8, 2022

Ok thank you for your answer.

So you mean, that I enter for ID a smartphone and then the result shoul be for example three purchase orders that were linked to the smartphone? 

Do I understand it right? 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 9, 2022

I mean the ID of a Jira issue where you have added a "Hardware Item(s) - Purchase Order" link to another Jira issue.

Iris Studeny September 11, 2022

@Trudy Claspill Ok thank you for clarification. 

Now I did following:  

1. see Picture "Step 1" Step 1.PNG

2. No issue were found see picture "Result"Result.PNG

3. But phone has got one link see picture "PHONE-1283"PHONE-1283.PNG

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 12, 2022

The filter you showed in your Automation Rule and the filter you showed in your Advanced Issue Search are not the same. You added 

project = "Hardware Smartphone"

...to the Advanced Issue Search. Remove that so that your Advanced Issue Search matches the JQL in you Automation Rule to see if the you get any results.

Also, please show the Linked Issues section for PO-120.

Iris Studeny September 12, 2022

Ok thank you for the hint. 

You can find attached the Linked Issues section for PO-120 and also the new filter search for the automation rule- is this correct?

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 13, 2022

Hello Iris,

There were no attachments with you latest response

Iris Studeny September 14, 2022

Hello Trudy,

I am very sorry..

Now the attachments.section1.PNGsection2.PNGsection3.PNGsection4.PNGissuesearch.PNGResult.PNG

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 14, 2022

Hello @Iris Studeny 

I am going to recommend that you raise this issue directly to Atlassian Support.

https://support.atlassian.com/contact/

I did a test with a very small data set, and in my test the clause "issueLinkType = "<value>" did not return the correct results.

I have a link type called RelatedBug with an Outward description of "is bug child of" and an Inward Description of "has bug".

I have an issue CK-1 with 5 linked issues. Among those are two links that show "is bug child of" and one link that shows "has bug".

When I use the filter 

issue in linkedIssues(CK-1) and issueLinkType = "is bug child of"

The output should contain the two issues under the "is bug child of" linked issues heading. Instead it contains only one of those issues and incorrectly also include the issue under the "has bug" linked issues heading.

I think that there may be a bug in the filtering for issueLinkType.

Evan Reeves October 4, 2022

I want to add that I am seeing the same behavior. When I am using {{lookupIssues.size}} it indeed returns 0 as the count, which is not correct. In my case there are 32 issues returned in the search.

Chris Rogers December 15, 2022

Does anyone know if there is an existing bug report for this behavior?  I recently saw something similar on a client's site, although I believe it was with comments rather than link types.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events