Forums

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

Update child tickets based on a query in bulk through API or otherwise

Tim Zhu March 13, 2023

Hi,

We have created a field in our Initiatives issue types called "Product Phase" that denotes the different phases in our product development lifecycle (PDLC).

As a part of the PDLC, we are auto-creating child Epics that represent checkpoints (CP) between phases and asking teams to close these CP in Jira.  When a user closes the CP ticket, we query based on the Summary for CP# - and then autoupdate the product phase.  There are 6 CP Epics in total for each Initiative with the summary title being:

  • CP1 - <parent project key>
  • CP2 - <parent project key>
  • CP3 - <parent project key>
  • CP3.5 - <parent project key>
  • CP4 - <parent project key>
  • CP5 - <parent project key>

 

We recently had folks update their product phase but we want to auto-close the child CP tickets through our API or other manner possible.  

  • If an Initiative has the Product Phase = “Full Lauch“ OR “Rollback” , all 6 CPs should be Closed with Resolution = Done.
  • If an Initiative has the Product Phase = “XP Rollout” , the first 5 CPs (CP1, CP2, CP3, CP3.5, CP4) should be Closed with Resolution = Done.
  • If an Initiative has the Product Phase = “Admin Testing” , the first 4 CPs (CP1, CP2, CP3, CP3.5) should be Closed with Resolution = Done.
  • If an Initiative has the Product Phase = “Build and QA” , the first 3 CPs (CP1, CP2, CP3) should be Closed with Resolution = Done.
  • If an Initiative has the Product Phase = “Solution Scoping” , the first 2 CPs (CP1, CP2) should be Closed with Resolution = Done.
  • If an Initiative has the Product Phase = “Concept” , the first CP (CP1) should be Closed with Resolution = Done.

The question here is how do I write the call to the API to do this bulk automation if I know my project keys?  Is the API the best way or is there another way that this could be handled? 

2 answers

0 votes
Kristopher Perez
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.
March 15, 2023

This is an interesting use case, and I'm trying to wrap my head around what you are trying to do.

First, let me clear out assumptions.  Are you asking for an ongoing automation or are you simply trying to play catch up and get everything up to date?

Assuming you are just trying to catch everything up right now, I would probably create an Automation to help though this.  I haven't tested this out yet, but I'll at least walk you through what I'm thinking.

  • Trigger - Schedule (the time doesn't matter, since we are going to use the "Run" option and Restrict to JQL of just one Initiative.   This is for testing purposes.
key = INITIATIVE-1 and project = INITIATIVE and phase in ("Full Launch“,“Rollback")
  • Advanced Branch - JQL
"Parent Link" = {{issue.key}} and (Summary ~ "CP-1" OR Summary ~ "CP-2")
  • Add Comment
"This issue should be closed because {{issue.parent.key}} is currently in {{issue.parent.Phase}}"

Once this is saved, you can get the "Run" button at the top of the Automation which you can run immediately and check that you are getting the result you are looking for.  

If you are happy with it here are the changes to make:

  • Add Comment to Transition
  • Remove the key constraint on the initial trigger
  • I would recommend doing one of these automations for each phase
  • When you are done with this clean up make sure to disable the Automation so it doesn't trigger on the schedule

Hope that helps, let me know how this works for you.

Kris

Tim Zhu March 15, 2023

Hi @Kristopher Perez , thanks for that.  We currently have this automation running across each team's projects so that's around ~50+ teams/projects.  

 

While the automation suggestion is a good one, I dont know if it's scalable across multiple projects.  (maybe i add the automation to each project and run it once?)

This is why I was hoping to get an API solution vs using the automation UI. Any chance you know how this would work through API?

0 votes
Tim Zhu March 14, 2023

Hi @Kristopher Perez ,

 

Based on the above configuration, do you know how we could query for Inititiatives that match the scenarios I listed above? 

Ie, an example would be return Initiatives that are in the product phase Admin Testing but does not have the child ticket CP3.5 closed?

Suggest an answer

Log in or Sign up to answer