Hello all;
I have banged my head. (still a newbie)
I want to write a comment or send email to include:
I have tried about 15 different examples found all over the place but not having any luck.
Can you point me in the right direction?
Closing:
It sounds like what I'd like accomplish is not possible with a comment or email. Which is fine, I don't want to waste time if not possible.
Hello @John McConnell
Were you making use of this reference?
https://confluence.atlassian.com/automation/jira-smart-values-conditional-logic-1081351607.html
It does not appear that the logic supports an else condition for Jira Data Center.
Does the structure of your rule enable you to use an If/Else Block condition instead, and format two different messages?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I have attempted your recommendaiton link, but no data.
Blocks don't seem to be an option here.
example of message/email
{{Fix Version/s.value}} value
{{Fix Version/s.name}} name
{{Fix Version/s}} plain
{{#if(Fix Version/s.value.isEmpty)}}
Release - TBD value
{{/}}
{{#if(Fix Version/s.name.isEmpty)}}
Release - TBD name
{{/}}
{{#if(Fix Version/s.isEmpty)}}
Release - TBD field only
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you show us your entire rule? We are missing some information about the context within which you are trying to use this code.
If the context of this code is such that the action has a single issue in context then to reference the Fix Version/s field you should be using the smart value
{{issue.fixversions}
Fix Version/s is also a multi-value field, so if you want to look at the name of a specific Fix Version within that field you have to identify which one you want.
Reference: https://confluence.atlassian.com/automation/jira-smart-values-issues-993924860.html
I think you should be able to use
{{#if(issue.fixversions.isEmpty)}}
Release - TBD value
{{/}}
And you should be able to use
{{#if(not(issue.fixversions.isEmpty))}}
{{issue.fixversions.first.name}}
{{/}}
If the Fix Version/s field contains more than one value, how do you know which one you want to include in the message?
Or you could use an If/Else condition block in your rule, potentially
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello thanks for the feedback.
The "code" will go in an email out to a distro of users but here is the comment with your code recommendation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are going to use an If/Else Block condition like the example I provided, then you would not need the {{#if(.... {{/}} syntax within the message/comment content.
Just use the plain text:
Release - TBD
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Trudy;
This isn't a block workflow for the fix version, it is an email that gets triggered when the status is ready for dev, then we send an email with information, including the fix version to our business partner. So that is why I want to formulate the if value is empty then something, else value.
It sounds like what I'd like accomplish is not possible with a comment or email. Which is fine, I don't want to waste time if not possible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think what you want to do is possible. I'm not clear why you don't think it is possible.
In this example I used the Comment action but you could use the same syntax in a Send Email action. The rule makes one type of Comment if Fix Version/s is empty, and another Comment listing the Fix Version/s values if the field is not empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.