Challenges with Chained Automation for Dynamic Looping in Jira Using Webhooks

Caressa DeQuardo January 6, 2025

Objective:

I'm working on an automation setup in Jira to dynamically create a specific number of Child issues linked to an Epic. The desired number of issues to be created is defined by a custom field on the Epic. This setup should:

  1. Dynamically create anywhere from 1 - 1,000+ child issues (depending on the value in the custom field)
  2. Ensure the automation stops when the required number of issues has been created
  3. Use webhooks to overcome JIra's automation limitation of not supporting direct Secondary Loop Auto Validation.pngPrimary Loop Auto Validation.pngSecondary Loop Auto Audit Log.pngPrimary Loop Auto Audit Log.pngSecondary Loop Auto 2.pngSecondary Loop Auto 1.pngPrimary Loop Auto.pnglooping or counters.

 

Context:

1. Primary Automation:

  • Triggered by a status transition of an Epic.
  • Validates a custom field (let’s call it customfield_11064) that contains the number of "Audit Work" issues to be created.
  • Sends a POST Web Request to a secondary automation with the following payload:

{"epicKey": "{{issue.key}}","remainingIssues": "{{issue.customfield_11064}}"}

  • Logs confirm the payload is being sent successfully with the correct data.

2. Secondary Automation

  • Triggered by an Incoming Webhook from the primary automation.
  • Should create "Audit Work" issues for the corresponding Epic based on the remainingIssues value.
  • Sends an updated payload back to the primary automation to decrement the remainingIssues count and continue the loop.

Problems Encountered:

1. Webhook Payload Not Registering in Secondary Automation:

  • Although the primary rule sends the payload successfully (confirmed via logs), the secondary rule does not seem to recognize the remainingIssues or epicKey values when using {{webhookData}}.
  • A log action in the secondary rule only shows
    • Webhook Payload Received: epicKey = , remainingIssues = .

2. Delay Issues in Primary Automation:

  • Initially, the custom field (customfield_11064) value wasn’t being sent in the payload because the automation ran too quickly. Adding a delay by triggering the primary rule on a status transition resolved this.
  • However, this workaround doesn’t address the webhook data issue in the secondary automation.

3. Chained Automation Fails to Continue Loop:

  • The secondary automation doesn’t seem to properly send the updated remainingIssues value back to the primary rule for continuing the loop.

Steps Taken So far:

1. Verified the Incoming Webhook trigger in the secondary automation is configured to:

  • Use the same webhook URL as provided in the primary rule.
  • Execute with Issues provided in the webhook HTTP POST body.

2. Logged the payload in both automations

  • Primary rule logs show the payload is sent correctly with the expected epicKey and remainingIssues values.
  • Secondary rule logs show no values for the webhook data.

3. Experimented with .asJsonString and other variations to format the payload in the primary rule.

  • {"epicKey": "{{issue.key}}","remainingIssues": "{{issue.customfield_11064.asJsonString}}"}
  • This didn’t resolve the issue.

4. Tried alternative configurations for referencing the payload in the secondary rule:

  • {{webhookData.epicKey}}
  • {{webhookData.remainingIssues}}

Questions for the Community:

  1. Why is the secondary automation not recognizing the payload values from the webhook? Is there a specific configuration I’m missing?
  2. How can I ensure the secondary rule properly processes the remainingIssues value and sends it back to the primary rule to continue the loop?
  3. Is there a better approach to implement dynamic looping in Jira Automation when no native looping feature exists?
  4. Any insights, examples, or alternative methods would be greatly appreciated!

Thank you in advance for your help!

0 answers

Suggest an answer

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

Atlassian Community Events