Dear ALL,
who can help me out?
I have created an automation rule which triggers upon issue transitioned and the action is simply to update the assignee field with the current value of a multiple choices field (select list) called in my case Responsible.
This rule runs with NO error, indeed, the log reports “Issues edited successfully” BUT nothing has happened actually, I mean, the assignee has NOT changed as I wanted.
This is my syntax:
{
"fields": {
"assignee": { "name": "{{issue.Responsible.name}}" }
}
}
I use Jira DC version 9.12.12.
Thanks in advance, Vincenzo.
Hi Vencenzo,
Jira doesn't know which value of a multiple value field to get to put in a single assignee. You can do this to get the first value in the multi-field though.
In the box for the Assignee field, put this:
{{issue.Responsible.get(0).accountId}}
Hi John,
I have tried that out:
no errors but the assignee has not changed and from the log the smart value of {{issue.Responsible.get(0).accountId}} is empty, it's empty also for {{issue.Responsible.get(1).accountId}}.
Thanks, Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
fine, now the log is giving the user name, so I use this syntax:
{
"fields": {
"assignee": { "name": "{{issue.Responsible.get(0)}}" }
}
}
but you get the following error message:
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.
Hi @John Funk
sure I can edit manually but that's my challenge: I wouldn't know a priori who is going to be the user being responsible of the issue which has transitioned.
Kind Regards, Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just trying to make sure that the user you are trying to use actually can be added as the assignee. It's not that I am suggesting that as a solution, just trying to make sure that you can be put into the Assignee field.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe try with another user in the custom field. Maybe use a project Administrator for that project just to ensure all of the permissions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So you have a multi select, but you're using a json path to a single value. Of course that won't and shouldn't work.
If it's "multiple choices field (select list)" I would imagine it's an option based field, but I hope it really is a multi user picker?
How do you choose which user to pick from the list and how do you handle a scenario where the list is empty?
Consider logging the value you're getting from "{{issue.Responsible.name}}" to see what you're getting.
After that I assume you will need to get a single value from the list like this https://confluence.atlassian.com/automation/jira-smart-values-lists-993924868.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, it's a multi user picker whose value it's already set within the Jira ticket (for example to me).
NO scenario at all where the list is empty because at the time of creating the ticket I set this field (Responsible) to one of my team member.
The log of {{issue.Responsible.name} is empty actually but then I have logged {{issue.Responsible.value} and the value is the current user (for example myself).
So, I have used the following syntax:
{
"fields": {
"assignee": { "name": "{{issue.Responsible.value}}" }
}
}
And now you get this error message:
Thanks for letting me know,
Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, just do issue.Responsible.get(0).name as you did - the only difference is the getter by index.
Or issue.Responsible.first.name to make it more "readable".
It does surprise me that it would be empty in your original format though. Purely json-syntax wise it is not a valid getter, but A4J documentation makes it seem that it should return the array of names. Meh, either way.. first.name should work.
EDIT
Oh also, iirc assignee and users should be mapped by keys.
If this still doesn't work can you try a combination of:
assignee: { "key": {{issue.Responsible.first.key}} }
Maybe the docs are confused, or I'm confused, but in any other API it uses keys so I think that might also be a potential thing to look out for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Radek Dostál.
Done that; no errors but no result: the assigneed has NOT changed despite the log says "Issues edited successfully".
Cheers, Vincenzo.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hm, dunno.
These both work though just tried:
or
I'm guessing it's the missing quotes, realized while editing that the smart value returns the "pretty" string without quotes, so you might be probably missing it in your json.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks again @Radek Dostál.
As before: no errors but the assigneed has NOT changed despite the log says "Issues edited successfully".
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.