Automation: Set approval when creating issue

Tim H_
Contributor
July 31, 2024

I have an issue type "Create user account", which has to be approved. In the same way, I have an issue type "Order hardware". In both cases, the approval works flawlessly.

Now, I have another issue type "New user", which also has to be approved. After that approval, I want to use automation to automatically create linked issues "Create user account" and "Order hardware". That also works perfectly. I can copy all the values I need to the new issues via automation.

However, I don't want to ask for approval for the linked tickets as well. The main ticket ("New user") already has been approved.

I can copy the approver to the new issues, but of course, the transition doesn't fire in the linked issues.

Possible solutions that I think about (but did not get to work):

- I add a custom field "approved" to the new tickets and auto-fill it with "yes". I can now trigger a rule "If new issue is created AND approved = yes". However, I don't know how to generically mark the ticket as approved. The linked issues have different workflows with different statuses.

- I could create distinct issue types: "Create user account (with approval)" and "Create user account (without approval)". That would make things easy. But I would have to have two distinct issue types for each kind of linked issue hierarchy. I'd like to avoid that if possible.

Any help is greatly appreciated!

Best regards,

Tim

2 answers

2 accepted

2 votes
Answer accepted
Jovin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 31, 2024

Hey @Tim H_ 

Here's how I would approach it.

  1. Modify your workflow to include a separate transition from the "Waiting for approval" step into the "Open" step (called say "Preapproved")
  2. Modify the conditions of this transition so that it:
    1. Is not blocked by pending approval
    2. "User is in project role" and make sure you choose "atlassian-addons-project-access"
  3. Publish your workflow

Now, in your automation that creates the child requests, make sure they are not in branches when it creates them and add a new "Branch" to the end:

  • Branch should be "Branch rule / related issues" and set it to "All created issues" (this will run for both of the created issues)
  • In that branch add an action "Transition issue" and choose the desired status (e.g. Open), then click the blue link for "+ add regex to distinguish between multiple transitions to the same status"
  • Type in the name of the transition (e.g. Preapproved)
  • Then, for audit purposes you could put an internal comment saying "Pre-approved through parent request" or something
Tim H_
Contributor
July 31, 2024

Thank you! That works.

0 votes
Answer accepted
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 31, 2024

Hey Tim,

Yes, I would go the custom field route you mentioned in the first option.

Tim H_
Contributor
July 31, 2024

Thank you, but I went Jovin's route.

Like John Funk likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.1.2
TAGS
AUG Leaders

Atlassian Community Events