Automatically assign Project Lead for 'High' priority issues

Automatically assign Project Lead for 'High' priority issues

Goal

When an issue is created with a specific Priority value, automatically assign it.

Goal

When an issue is created with a specific Priority value, automatically assign it.

Scenario

You want to automatically assign any high-priority issues to your Project Lead. The Project Lead can review the issue for accuracy and then reassign it as necessary. High-priority issues could have a specific Priority value or use custom fields to designate them.

Components

Script action

Baseline

  • Only issues with a specific value or values for the Priority field will be affected.

  • Issue assignment will not be updated if the Priority changes.

You are viewing the documentation for Jira Cloud.


Requirements

  • Jira Administrator login

  • Live Fields for Jira Cloud

  • You need to determine which Priority value or values will trigger automatic assignment.

Create the live fields configuration

  1. For Screens, select Issue create view, Issue view, and Issue transition view.

  2. Click Projects, and then click Select projects in the right-hand panel.

  3. Select the project or projects to which your configuration should be applied.

  4. Click Issue types, and then click Select issue types in the right-hand panel.

  5. Select the issue types to which your configuration should be applied (for example, Story and Task).

  6. Under THEN, click Add Scripted action, and then click Start scripting in the right-hand panel.

  7. Enter the following script:

 

useCase-AssignProjectLeadHighPriority.png
Figure 1 - Live field configuration

 

// Check if the current issue's priority is set to "High" if (getFieldById("priority").getValue()?.name === "High") { const context = await getContext(); const { extension: { project } } = context; // Fetch details of the current project using its ID or key const projectDetails = await JiraApi.ProjectsService.getProject({ projectIdOrKey: project.id }); // Get the project lead information from the project details const projectLead = projectDetails.lead; // If a matching user is found, set them as the assignee if (projectLead) { getFieldById("assignee").setValue(projectLead.accountId); } else { logger.warn(`Project lead not found. Assignee not set.`); } }
  1. Click Save.

  2. Check the boxes for On load and On change to set the configuration to trigger only when the issue is updated.

  3. Click Save.

Enable and test your configuration

Your configuration is now complete. Verify that the configuration is enabled on the Live Fields administration page. Once it’s enabled, you can test it by creating a new issue with a Priority value of ‘High’ and verifying that the issue is assigned to the correct user.

Congratulations!

You can now automatically assign an issue based on the value of a field!

 

Need support? Create a request with our support team.

Copyright © 2005 - 2026 Appfire | All rights reserved.