Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

how to write parser expressions updating fields with automation rules

What should the syntax be for updating fields using smart values in automation rules?

I am using an on-premise version of Jira.

I have written a rule that is triggered when a comment is added.

In this simplified example I want to add the last comment concatinated to the description field.
In the end I will use instr() and indexof() functions to get a provider case number from the comment field and add it to the name field.

What works is adding the comment as it is to the description.
Using basic parsing mode the parser expression is this:
%{trigger.issue.lastComment}%{trigger.issue.description}


What does not work and what I want to achieve is this:
%{trigger.issue.description.concat(trigger.issue.lastComment)}

Also tried different versions
%{trigger.issue.description}.concat(trigger.issue.lastComment)
{{trigger.issue.description.concat(trigger.issue.lastComment)}}
{{trigger.issue.description}.concat(trigger.issue.lastComment)}

What I now see in the description is the parser description itself.

What should the parser expression look like?

2 answers

This is the first time I work with Jira, but I am quite certain we use Automation for Jira. I have added a larger screenshot that shows this.

We are using an on-premise version 8.8.0

AutomationRuleQuestionLarge.PNG

Hi @Trond Meistad -- Welcome to the Atlassian Community!

Would you please post an image of your complete rule?  That may provide context for the community to offer suggestions.  Thanks!

Until then...Please take a look at documentation for the available smart values for Jira Server/Data Center, automation.  That may help.

https://confluence.atlassian.com/automation/using-smart-values-993924627.html

For example, the last comment's body from the trigger issue is:

{{triggerIssue.comments.last.body}}

 

Kind regards,
Bill

Hi.

If I type {{triggerIssue.comments.last.body}}, the text gets a black font color and is added as {{triggerIssue.comments.last.body}} text in the description field. Obviously it is interpreted as plain text.

AutomationRuleQuestion2.PNG

This is what it looks like when a comment is added

AutomationRuleQuestion2Result.PNG

Here is the rule definition. In the final rule it will be string operations that will pick up the case number that always starts with "AB-" and add it to the end of the Jira case name.

AutomationRuleQuestion.PNG

My apologies as I thought you were using Automation for Jira (the Lite or Pro version).

I am not using the Server/Data Center version and so did not recognize your tool, and instead you appear to be using something else to perform the automation.

What are you using to create the automation?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

379 views 18 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you