Our new Appfire Documentation Space is now live!

Take a look here! If you have any questions please email support@appfire.com

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

Abstract

This code snippet assigns the issue to a specific user if the issue is unassigned.

Logic

Check for a value on the Assignee and based on the result, assign the issue to a specific user

Snippet

{% if issue.fields.assignee.name == null %}
{{ <Application User Object or a String representing a Username> }}
{% endif %}

Placeholders

Placeholder

Description

Example

<Application User Object or a String representing a Username>User object or username of the specific user{{ issue.fields.project.lead }} or {{ issue.fields.project.lead.name }}

Examples

{% if issue.fields.assignee.name == null %}
{{ issue.fields.reporter.name }}
{% endif %}
{% if issue.fields.assignee.name == null %}
{{ issue.fields.project.lead }}
{% endif %}

(warning) You need to select "Treat as JSON" option when the script returns an user object

Context

The output of this code is either a user object or a String representing a username. When it returns a user object, you would use this code to set a User picker field in one of the Set Field Value post-functions. You need to select the "Treat as JSON" option. When it returns a String representing a username, you would use this code to set a User picker field in:

  • one of the Transition issue post-functions on the transition screen, if any
  • the Create issue post-function under Set fields of new issue section

Use cases

A typical use case would be to assign the issue to the Project lead if it is unassigned - Assign the issue to the Project lead, if the issue is unassigned on creation

Reference

Filter by label

There are no items with the selected labels at this time.

  • No labels