Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I add alternatives to the User dropdown list?

Daniel.Adersteg June 11, 2021

I want to create an automation with a user condition. See below:

automation-conditions-8.png

I want the condition to check if Reporter = Approver. I am, however, not sure how to add alternatives to the drop down list. The dropdown list seems to be a mix between standard values and manually added value, but I tried to create a value and it does not show up (It is a People-Field) 

This is how the dropdown look  

 

Screenshot 2021-06-11 at 09.34.46.png

I do not need a manually created value if I can access the "official" Approvers  field but none of the alternatives in the list seemed to work.  

 

Anyone have an idea what the problem might be here?

1 answer

0 votes
Alex van Vucht (GLiNTECH)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 11, 2021

If an issue is pending approval, then the special "Approvals" field tells you who can approve a request.

If you retrieve an issue via the REST API, as suggested by https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/ the Approvals field looks like this:

 "customfield_10100": [
      {
        "id": "1",
        "name": "Waiting for approval",
        "finalDecision": "pending",
        "canAnswerApproval": false,
        "approvers": ["approver":jiraUser,"approvalDecision":"pending"],
        "createdDate": {
          "iso8601": "2021-06-07T12:41:16+1000",
          "jira": "2021-06-06T21:41:16.299-0500",
          "friendly": "Monday 12:41 PM",
          "epochMillis": 1623033676299
        },
        "_links": {
          "self": "https://are-media.atlassian.net/rest/servicedeskapi/request/43862/approval/1"
        }
      }
    ],

Try an advanced compare condition like:

First value: {{#issue.Approvals}}{{if(equals(finalDecision,"pending"),approvers)}}{{/}}

contains

Second value: {{issue.reporter}}

Daniel.Adersteg June 11, 2021

Hi @Alex van Vucht (GLiNTECH) 

Thank you for the response.

I got a this error when I tried to publish the rule 

Error parsing template: Failed to close 'issue.Approvals' tag

Daniel.Adersteg June 11, 2021

I removed the # and then I was able to publish it, but I got this error message when I tested the rule 

Action details:

Advanced compare condition

Error rendering smart-values when executing this rule:Failed to get value for if(equals(finalDecision,"pending"),approvers){{/

Alex van Vucht (GLiNTECH)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 14, 2021

@Daniel.AderstegThis is a tricky expression and I made a syntax error in not closing the braces on the if statement. I've corrected the statement above, and made bold where I did the error. Spend enough time staring at Smart Values and your eyes go a little cross-eyed, but it's better than the alternative!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events