Forums

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

Custom Field - Cascading List - Get Parent Field, Count Child Field Issues

Drew G
Contributor
April 21, 2023

Hello - 

I've been trying to find a solution to count the number of Issues that contain ANY child fields within a parent field on a cascading list custom field. 

What I'm trying to achieve, via the basic pie chart gadget on the dashboard, is to build a filter that shows the number of issues that exist within a parent field in a cascading select list.

For example: I have 2 parent fields with some child field options:

- Virginia

    - Richmond, Charlottesville, Culpeper

- North Carolina

    - Raleigh, Chapel Hill, Durham

 

I want the pie chart to show Virginia and North Carolina, and then be able to tell me how many issues exist with ANY of the child selections.

Does that make sense? I've been struggling to articulate this, which has made it more difficult to find a solution.

So far the only JQL I see is the cascadeOption() syntax, and that doesn't seem to be the solution. Any ideas?

4 answers

1 accepted

0 votes
Answer accepted
Deleted user
June 7, 2018

finally found answer:

had to reorder fields

 

headers = {"Content-Type": "application/json"}
data = {"fields":{"labels":["MANAGED_SERVICES"],"reporter":{"name":"user"},"assignee":{"name":"emergencyadmin"},"project":{"key":"CP"},"summary":"OC SPLA usage report for {previous_month} {currentYear},"description":"some descr","issuetype":{"name":"Managed Service"},"customfield_10107":{"id":"10505"},"customfield_10006":"CP-3289"}}}

1 vote
Rambabu Patina {Appfire}
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 Champions.
June 7, 2018

Could you verify that you've got "labels" on the screens for project CP and issue type "Managed Service"?

Deleted user
June 7, 2018

thanks for reply, i posted a picture-managed_service is visible from drop-down menu

Rambabu Patina {Appfire}
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 Champions.
June 7, 2018

Hi @[deleted], Can you include the 'creator' and 'labels' attributes with in the project scope in the JSON file. Like below.

{"fields":{"project":{"key":"CP"},"summary":"OC SPLA usage report for {current_month} {currentYear}".format(**locals()),"description":"Review OC SPLA usage report","issuetype":{"name":"Managed Service"},"customfield_10107":{"id":"10505"},"customfield_10006":"CP-3289","creator":{"displayname":"some user"},"labels": ["MANAGED_SERVICES"]}}
Deleted user
June 7, 2018

  "creator": { "active": true, "avatarUrls": { "16x16": "https://secure.gravatar.com/avatar/5d92f3ce51d4a090cdcb9b77ee890989?d=mm&s=16", "24x24": "https://secure.gravatar.com/avatar/5d92f3ce51d4a090cdcb9b77ee890989?d=mm&s=24", "32x32": "https://secure.gravatar.com/avatar/5d92f3ce51d4a090cdcb9b77ee890989?d=mm&s=32", "48x48": "https://secure.gravatar.com/avatar/5d92f3ce51d4a090cdcb9b77ee890989?d=mm&s=48" }, "displayName": "some user", "emailAddress": "someuser@company.com", "key": "someuser", "name": "someuser", "self": "https://jira.corp.company.com/rest/api/2/user?username=someuser", "timeZone": "Europe/Belgrade" },

 

"labels": [ "MANAGED_SERVICES" ], "lastViewed": "2018-06-07T10:09:11.206+0000",

 

sorry for bad formatting

0 votes
Deleted user
June 7, 2018

1.png

0 votes
Aleksandr Zuevich
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 Champions.
June 7, 2018

Hi Dragan,

is it your exactly sent json?
{"fields":{"project":{"key":"CP"},"summary":"OC SPLA usage report for {current_month} {currentYear}".format(**locals()),"description":"Review OC SPLA usage report","issuetype":{"name":"Managed Service"},"customfield_10107":{"id":"10505"},"customfield_10006":"CP-3289"},"creator":{"displayname":"some user"},"labels": ["MANAGED_SERVICES"]}

It has something strange like .format(**locals()).

Deleted user
June 7, 2018

Hi Aleksandr,

current_month = datetime.now().strftime('%B')
currentYear = datetime.now().year

subject contains current month and year, that's why i put .format(**locals()), it's python interpolation syntax

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events