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

Set Insight field using Automation passing reporter email address smart value to IQL syntax

Horacio Escalada July 28, 2021

I created a simple automation to set a value in an Insight Custom Field.
The goal is to use the Reporter Email Address as a parameter in the IQL syntax



rule001.png

When hardcoding the email address "Email" = "reporter_email@domain.com" the rule works.

However when replacing the email value with a Smart Value the rule log info states "No objects were returned from query"

These are the two IQL using smart values I tested with:

"Email" = {reporter.emailAddress.asJsonString}

"Email" = {reporter.emailAddress}



Thanks in advance!


1 answer

1 accepted

1 vote
Answer accepted
Ravi Sagar _Sparxsys_
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.
July 28, 2021

Hi @Horacio Escalada 

Try this.

"Email" = "{{reporter.emailAddress}}"

Smart value should be in double quotes.

Ravi 

Horacio Escalada July 28, 2021

Thank you @Ravi Sagar _Sparxsys_ Ravi. I enclosed the smart value with double quotes and it does work!

If you want to go "the other way" and get data out of an Insight field that is on an issue the following worked for me using Automation Rules:

 

ApproversJiraField is my Jira customer field of type Insight
ApproverUser is an attribute of type 'User' in the Insight db

Example 1 - this an example of what I put into a "add Comment" Automation.

The app name from insight is {{ApproversJiraField.Name}},   approvers are {{ApproversJiraField.ApproverUser.Name}}, {{ApproversJiraField.Approver2}},
Example 2 - Set assignee based on value from the issue's Insight field.
{
    "fields": {
        "assignee":  { "id":"{{ApproversJiraField.ApproverUser.accountId}}"  }
    }
}
Example 3: - set the Approvers customer Jira field based on a 'User' attribute in the issue's Insight field.  Here Approvers can hold multiple values (array) so converting it an array with square brackets []
{
    "fields": {
        "Approvers": [ { "id":"{{ApproversJiraField.ApproverUser.accountId}}"  } ]
    }
}
Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events