Automation rule to Sum up Completed Story Points in an epic by custom status
Asked by christopher_branaman:

Company Managed/Cloud

I created a new field called Points Complete.

Whenever a card is moved to Done, I would like to see this field in the Epic populated with the total story points of completed cards.

Here's the rule I created -

When: Value changes for Status

Issue Type does not equal Epic

Condition And: Parent exists

Then: Lookup issues  
parent = {{triggerIssue.parent.key}} AND statusCategory = "Done"

Branch

For: Parent

Then: Edit issue fields

Choose fields to be set = Points Complete  
{{lookupIssues.Story Points.sum}}

The Automation is working exactly as it should, however I would like to filter the results a bit more.

Example: the current formula is looking for statusCategory = "Done"

This in turn is pulling all combined cards that would equate to a Done value (.e.g. Cancelled, Duplicate, Not A Bug, etc).

Is it possible to query by custom Status value so that those others mentioned above are not being included?? Or if I wanted to include one of the "In Progress" statuses as well as done, such as cards in the Product Review column?


Answers:
author: Trudy Claspill
body: Hello [@christopher_branaman](/t5/user/viewprofilepage/user-id/4667660)

Yes, if you want your query to be based on individual statuses rather than status category change it thus:

parent = {{triggerIssue.parent.key}} AND status in (\<comma separated list of individual status values\>)

comments: author: christopher_branaman
body: I edited to the following

parent = {{triggerIssue.parent.key}} AND status in "Done, Product Review"

And it failed.

Screenshots attached (including the Audit Log)

![Screenshot (99).png](https://community.atlassian.com/t5/image/serverpage/image-id/332192i31C414A7F381BAEE/image-size/large?v=v2&px=999 "Screenshot (99).png")![Screenshot (100).png](https://community.atlassian.com/t5/image/serverpage/image-id/332193i69CD206012065A00/image-size/large?v=v2&px=999 "Screenshot (100).png")


author: christopher_branaman
body: Figured it out. It was successful using the following:

parent = {{triggerIssue.parent.key}} AND status in ('Done', 'Product Review')


author: Trudy Claspill
body: Your JQL syntax is incorrect. The comma separated list of Status values needs to be enclosed in parentheses.

parent = {{triggerIssue.parent.key}} AND status in **(** "Done, Product Review"**)**


author: christopher_branaman
body: I disagree. I tried it the way you presented it above and it failed.

The query I listed above is working without issue.


author: Trudy Claspill
body: I think my reply and your "figured it out" reply posted at the same type, because I was referring to the JQL you had in your original post.
> parent = {{triggerIssue.parent.key}} AND status in "Done, Product Review"

But I see I also had a typo in my reply. The parentheses needed to be added, the quote marks surrounding both values removed, and quote marks added around just the **Product Review**value. You don't need quote marks around a value that doesn't include spaces, but it doesn't hurt to have them.

I had intended my reply to have the this JQL similar to what you posted in your "figured it out" response.

parent = {{triggerIssue.parent.key}} AND status in **(** Done, **'Product** Review**')**

My apologies for the confusion.


author: christopher_branaman
body: No problem at all. Thank you for your responses!


Tags: cloud

jira-cloud