Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×
Say you want to set the value of one or more fields based on a lookup of other fields. (What does that even mean, Darryl?)
Well, let's say that you use Components to not only assign tickets to the Component Lead when a ticket is created, but you also need to designate an Executor per Component that will carry out the ticket after it is approved. You want the ticket assigned to the Executor automatically at that stage.
Or in a more complex example, you might have several "key" fields (Release, Phase, Build Area) that in various combinations map to "target" fields: primary and secondary approvers from Engineering and Build teams. Whenever one of the "key" fields changes, you'd want to update the approvers accordingly.
With on-prem Jira you could accomplish this ScriptRunner or Power Scripts, and if you use Automation, you could create a rule with multiple IF-ELSE blocks, or multiple rules for each variant.
But it would be even better to delegate management of these mappings to project owners (leads, managers, and so on) without having to edit a complex Automation Rule. Jira Admins would not have to handle those requests, and changes could be implemented faster.
If you create a separate project to hold your mappings, you can create a simple Automation that looks up the mapping based on your "key" fields, and can take actions based on "target" fields, like assigning to the looked-up values or updating the issue with the newly looked up values.
You'll need to set up a separate project to hold your mappings.
The steps are:
It's a good idea to make custom Screen and Field schemes in case you need to create other mappings restricted to different sets of users. You can simply create a new project that shares settings with the existing mapping project.
Here's a simple example and rule. The scenario is we're already assigning an issue to Component Lead for Review. When the issue moves to In Progress, the issue needs to be assigned to a user known as the "Executor".
Issues in the SAMLOOKUP project have just two fields: Components and Executor. (I have automated having the Summary being rewritten to "Executor - {{issue.component}}" whenever Component is updated, but it will overwrite any existing Summary and on creation we can't leave it empty. See Simple Notes.)
So the issues look like this:
When an issue’s status changes to In Progress we want to assign the issue to the "Executor" value which is looked up in an SAMLOOKUP issue based on the Component. Here's what that rule looks like:
Hence we have the additional check to make sure the transition happened in the New Bugs project. (Initially I set this up as a Global Rule but we lose a lot of efficiency doing that.)
Here's a more complex example.
For this case, we want to catch when any of the fields in blue change. So we need to trigger on a Field Change for the project in question.
But other than that, the logic is very similar to the Simple Example above, and equally as uh, simple.
Many thanks to @Matt Doar, @Boris Berenberg - Modus Create, @Mikael Sandberg, @Huw Evans, @Dave Liao, @Susan Hauth [Jira Queen], and @Jack Brickey for their invaluable edits, suggestions, and encouragement.
Darryl Lee
Sr. Atlassian Systems Engineer
Roku, Inc.
San Jose, CA
192 accepted answers
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register Now
2 comments