Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I want to count how many child issues have a status of 'Closed' and put that count in the parent iss

koutarou ishibashi
Contributor
September 19, 2023

I'm not very proficient in English, so I might be mistaken, but I want to put the count of child issues with a status of 'Closed' in the parent issue's field using Jira Automation. Can you please advise me on how to do this?

2 answers

2 votes
Tom Lister
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 19, 2023 edited

Hi @koutarou ishibashi 

If you want to use automation, you can use something like this

Screenshot 2023-09-19 at 11.06.25.png

"Word Count" is a convenient numeric in my setup.

Its value is being set to

{{lookupIssues.size}}

that is the results of the JQL lookup

There are pros and cons to using editable fields vs read-only scripted fields that would depend on your use case.

What are you trying to solve?

Tom Lister
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 19, 2023

Screenshot 2023-09-19 at 11.06.25.png

koutarou ishibashi
Contributor
September 19, 2023

Thank you for your answer. It was solved by implementing it as I was taught.

Tom Lister
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 20, 2023

Hi @koutarou ishibashi 

If one of the answers solved your query, could you mark it as answer accepted for other members to find.

Like koutarou ishibashi likes this
koutarou ishibashi
Contributor
September 25, 2023

I'm sorry I don't understand the meaning

Tom Lister
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 2, 2023

Hi @koutarou ishibashi 

If you have got an answer to a question that solves your problem, you can click the "Accept Answer" button to indicate to other users with a similar issue that there is a fix.
Screenshot 2023-10-02 at 11.31.49.png

Best
Tom

0 votes
Raja Shekher
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 19, 2023 edited

Hi @koutarou ishibashi - You need to have a Scripted field which is available via Script Runner Plug-in and do something like below

 

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.SearchProvider
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter


def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchProvider = ComponentAccessor.getComponent(SearchProvider)
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField = customFieldManager.getCustomFieldObjectsByName("FieldName").first()
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

// jql query to get the Child Issues with Closed issues
def query = jqlQueryParser.parseQuery("issueFunction in issuesInEpics('project in (MyProject) AND status = "CLOSED')")

def results = searchProvider.search(query, user, PagerFilter.getUnlimitedFilter())

//Get Results
def result = searchService.search(jobUser, query, PagerFilter.getUnlimitedFilter())

def issues= result.getResults()

//log.warn("issues are" + issues)
return issues
koutarou ishibashi
Contributor
September 19, 2023

Thank you for your answer. JIRA Automation solved it

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
atlassian, atlassian government cloud, fedramp, webinar, register for webinar, atlassian cloud webinar, fedramp moderate offering, work faster with cloud

Unlocking the future with Atlassian Government Cloud ☁️

Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.

Register Now
AUG Leaders

Atlassian Community Events