How to Trigger Atlassian Automation Rules from a RoA Forge App

Hi all, our connect apps use the webhook triggers in Automation extensively to integrate events from our apps into Automation rules.

As we migrate to forge we need to stop calling the automation web triggers to earn the RoA badge. We cannot find examples of how have an app specific event (e.g. applying an signature to a work item) trigger an Automation Rule without breaking the RoA badge.

Appreciate if anyone has already figured this out. Thanks in advance
Chris

2 Likes

Your app could add an issue property to the work item and the automation rule could then be triggered by this property.

Thanks @t-bundt. We considered this but it seems a bit like a hack.

Customers would have to apply custom code to a rule to handle these stored property events and then clean them up. Also using a persistent store like this invites race conditions and conflicts as app events can happen concurrently. This could also break with read-only work items.

Hi,

You may use the Forge Action module (preview, if you can access it, did not test it myself) which would let you define custom automation actions that would appear in the Automation rule builder, or invert the flow and use Web Trigger Pattern: create Forge web trigger, then in Automation used “Send web request” action to call your web trigger URL, the Forge function will then receive the event and can do something eg. calling Jira API. Both would maintain RoA compliance.

My 2 cents

Thank you @frederictardieu . The Action module and the Forge web trigger do appear to let a Automation rule initiate activity in a Forge App.

Can these techniques be used in the opposite direction? To initiate an Automation rule when an event happens within the app? For example, one of our common use cases is that customers want to Transition a work item to a new status after a Signature event.

Appreciate your thoughts,
Chris

@Chris_at_DigitalRose is a “Signature event” a change in a specific field value? A Custom field?

If yes, the Forge app could make a change to the Jira issue that Automation can detect, with something like this:

await api.asApp().requestJira(route`/rest/api/3/issue/${issueKey}`, {
method: ‘PUT’,
body: JSON.stringify({
fields: { customfield_12345: ‘Signed’ } // “Signature Status” field
})
});

Automation rule would trigger on that change

  • Trigger “Field value changed” → Signature Status is “Signed”
  • Action: Transition issue to new status

@frederictardieu The signature metadata is stored in an issue property (json), so yes the Automatication rule could detect that something changed inside that property. But it would not be able to determine what specific event happened within this complex data set.

Similar to what @t-bundt suggested, we could create a secondary issue property as a pseudo event queue/interface that customers would have to create custom code to handle.

Maybe Atlassian would consider adding an invokeAutomationWebTrigger() function that is allowed within RoA


A trick would consist in adding kinda “signal” field alongside the property, so that when the Forge app updates the signature property, it sets a simple text field like Last Signature Event = “signature applied” or “signature revoked”, and have Automation triggers on that field value


1 Like

Update - We did find the related roadmap item in Forge. No date on it yet, but this is what we need: ROADMAP-121