How Can I Populate a Custom Field Value with the Name of the Ticket Assignee on Transition?

jjang February 25, 2022

Hello!

For my project board, I want to a make an automation for tickets that, when transitioned from 'draft' to 'to do', a custom field's value populates with the assignee of that ticket (if the assignee is one out of 3 select users). Since the project board has many issue fields, I must edit the field using advanced field editing. I'm running across errors with my script though and would appreciate any help!

Screenshot of one of my attempts below:

image.png

2 answers

1 accepted

0 votes
Answer accepted
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 25, 2022

Hi @jjang and welcome to the community!

I'm not sure that advanced field editing is required for this, but the value you want is dependent upon whether the custom field is short text or user picker:

Short Text

{{assignee.displayName}}

User Picker

{{assignee}}
jjang March 1, 2022

Hey, @Mark Segall  thanks for the welcome and helping out with my question!

The screenshot below tells me that if I can't find a field in the provided list, I should use the advanced section (there are too many field so only 50/1000 appear). I'd like to set the value of the custom field to the user picker, and am still receiving an error with the script in the second screenshot.

Screen Shot 2022-03-01 at 2.54.52 PM.png

Screen Shot 2022-03-01 at 3.00.41 PM.png

Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 1, 2022

That's strange - You should have a type-ahead available in the drop-down so it wouldn't matter how many custom fields you have. 

Anyway, it looks like you're missing an opening brace after the fields call out.  Try this:

{
     "fields": {
          "customfield_15600" :{{assignee}}
     }
}
jjang March 3, 2022

Hello @Mark Segall, when I check the audit log after testing the script, I receive this error: 

Screen Shot 2022-03-03 at 2.06.47 PM.png

Could this be related to the custom field not showing up on the drop down you mentioned? This is what the field looks like on the project board I'm working on. The image following is what I see when I search for the field in the 'edit issue' option.

Screen Shot 2022-03-03 at 2.00.53 PM.png

Screen Shot 2022-03-03 at 2.09.22 PM.png

0 votes
Mark Segall
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 3, 2022

Hi @jjang 

That is strange that the field is not showing in the list and yes that can most certainly be related to the failure when you try advanced field editing.  I would take a look at the following:

Permissions
There are a couple layers of permissions to consider:

  1. Creator of the rule - The person creating the rule should be a project admin or they may not see certain fields.
  2. Execution of the rule - Needs to have appropriate rights to perform all the actions when the rule is triggered.

Screens
Screen configurations will play into this.  If that field is not available on the Crete/Edit screens, automation will not be able to do anything with it so you need to make sure any fields are available on those screens.

Lastly, I noticed a small typo in my last response to you where I've added a space before the colon.  I don't think this matters, but try this to see if it makes any difference:

{
     "fields": {
          "customfield_15600":{{assignee}}
     }
}

Hopefully something above helps resolve the issue.

Suggest an answer

Log in or Sign up to answer