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?
Hi @Trond Meistad!
You're indeed using the automation rules of our product Jira Workflow Toolbox, so let me help you in getting that automation rule up and running. :) To simply add the last comment to your description, you can use the following expression. I also added a line break
%{trigger.issue.description}
+ "
"
+ %{trigger.issue.lastComment}
Please make sure to switch to the "Advanced text" parsing mode. It enables you to easily combine field codes with plain text in quotation marks "" and the + operator.
From here you could even add further information and add the user name of the last commenter, a timestamp, and much more. Here's a little example:
%{trigger.issue.description}
+ "
"
+ "Comment posted by "
+ %{trigger.issue.lastComment.author}
+ " on "
+ %{system.currentDateTime}
+ ": \""
+ %{trigger.issue.lastComment} + "\""
And the result will look something like this:
You can find a more detailed explanation and use cases in our document about the Advanced text parsing mode. Our app documentation is available on https://apps.decadis.net
Please let me know if you have additional questions!
Best, Max
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
This is what it looks like when a comment is added
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Looking at your image, you are using the Jira Workflow Toolbox's version of automation, and not the Automation for Jira app.
I have no experience with that tool, and I recommend taking a look at this documentation for the tool to see what you can find: https://marketplace.atlassian.com/apps/29496/jira-workflow-toolbox?tab=support&hosting=server
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.