Good afternoon,
I have a workflow where I want the assigned person to be selected based upon a field the customer selects when using the Service Desk help center. It's a drop down menu called Topic, and right now it has three options: Batman, Robin, Joker
On the Create Issue transition I added a Post Function right after "Creates the issues origionally" step. I have the Project Role set to Administrators, and the conditional execution is this:
if (cfValues['Topic'].getValue() == "Batman"){ return true }
I have also tried:
{% if issue.fields["Topic"] == "Batman" %} true {%endif%}
I've tried several other statements I've found on the internet but haven't had any luck. I do know that when I remove the conditional it does assign the incident to the Administrators group accordingly. Ultimatley, what I want to have happen is the group the ticket gets assigned to is based on the drop down selection.
Any thoughts?
Hi Dan,
first of all, the "cfValues" syntax is from another add-on so it won't work in JMWE.
Did you read the documentation here: https://innovalog.atlassian.net/wiki/x/KICcBQ ? And in particular this page: https://innovalog.atlassian.net/wiki/x/bwBzBg ?
You should test the following condition code:
{{ issue.fields["Topic"].value == "Batman" }}
which is a shorter version of
{% if issue.fields["Topic"].value == "Batman" %} true {% endif %}
David.
Thank you for the reply, sir.
Unforunatley, I'm still not having any luck. I did try
{{ issue.fields["Topic"].value == "Batman" }}
With the same result. Additionally, after reading those links I found the object ID of 10203, after examining the issue structure. This is what I saw.
atlassian.net/rest/api/2/customFieldOption/10203","value":"Batman","id":"10203"},
Thus, I tried updating the code to
{{ issue.fields.customfield_10203.value == "Batman" }}
and
{{ issue.fields.customfield_10203.name == "Batman" }}
and neither have been successful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The numerical ID you found is that of the custom field Option, not the custom field itself. But anyway using the field name should work.
Did you try testing your template (using the "Test Nunjucks template" link) against an existing issue that has the expected value in the Topic field? If it doesn't return the expected value, try simply displaying the value:
{{ issue.fields["Topic"] | dump(2) }}
to see what exactly is the value of that field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just tried the Test Nunjucks Template and got a true result value when using this code:
{{ issue.fields["Topic"].value == "Batman" }}
I tested again with a different value and got false. So it does look like that's working as it should. Thank you for that.
I am running it as an add-on user. Does that make a difference?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unless the add-on is not properly installed (which can happen because of a JIRA Cloud bug), it shouldn't.
However, are you aware that Cloud post-functions are asynchronous and therefore their outcome is not always visible instantly?
If it still doesn't work, I suggest you open a support request at: https://innovalog.atlassian.net/servicedesk/customer/portal/10
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your help. I did notice one more thing, though
If I set the Project Role to Administrators the rule works without any problems. However, if I change it to something else (Developers, for example). It fails.
Is there something I could be missing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apart from some constraints on who can be assigned to issues, I don't see any reason why it wouldn't work. Unless of course these project roles are empty for that particular project.
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.