Edit Issue Custom Single-User Field
Asked by tmaliszewski:

Hi All,

I am trying to define Automation rule for my team to automatically assign fields. I am struggling with a custom field type single-user picker. My field is not available via the 'Choose fields to set..' so need to go with JSON.

I tried following but none of the works:

{"fields": {"customfield_10829" : { "name": "61ead3cc9d1740006900db46"}}}

{"fields": {"customfield_10829" : { "id": "61ead3cc9d1740006900db46"}}}

{"fields": {"customfield_10829" : { "name": "currentUser()"}}}

{"fields": {"customfield_10829" : { "id": "currentUser()"}}}

also tried all above with using update/set but still getting same result, an error

*(data was not an array (customfield_10829))*

*Ideally I would like it to work on a team level so it should assign the field for current user.*

*Not sure where I am making things wrong.. Appreciate your help!*


Answers:
author: Ste Wright
body: Hi [@tmaliszewski](/t5/user/viewprofilepage/user-id/4766220)

What's the full rule? I assume the user picker is a custom field, not the assignee field?

It'd be good to clarify some things about the field also...

* Is the field on the Screen?
* Is it a visible field - i.e not hidden in the Field Configuration?

\^ Because if it's a normal User Picker (Single User), it should be possible to use without JSON.

For example, I used a custom field, Owner, and then used this rule to populate it:

* **Trigger:**Issue Created
* **Action:** Edit Issue
  * **Field:**Owner
  * **Value:** {{initiator}} - *this [Smart Value](https://support.atlassian.com/cloud-automation/docs/jira-smart-values-users/) populates Owner with the user who triggered the rule*

Ste

comments: author: tmaliszewski
body: Hi Stephen,

Thanks for your response.

The full rule is:

Trigger: When issue created

Condition: Reporter is current user

Action: Edit Issue (advanced = JSON, as the custom field I want to edit is not showing up on the drop down list. On the drop down list is a text: AVAILABLE FIELDS SHOWING 50 OF 391, but the custom one I am looking for is not there)

My JSON in the advanced edit issue is following:

{"fields": {"customfield_10829" : { "name": "61ead3cc9d1740006900db46"}}}

I tried all the above options but with same error.


author: Ste Wright
body: Hi [@tmaliszewski](/t5/user/viewprofilepage/user-id/4766220)

Is the field available if you search for it in the *Choose fields to set*field?

As I say, it'd be good to clarify why the field isn't showing rather than trying to resolve it with JSON (which still might not work if there's a reason the field is not editable).

It should be there in the list, there's no reason above which states otherwise.

Ste


author: tmaliszewski
body: Thanks Stephen,

Let me dig into it to try find out why that field is not showing up on the Choose fields field.

Thanks!

Tomasz


author: Ste Wright
body: No worries Tomasz!

Let us know how you go, and if we can be of any further help :)

Ste


author: tmaliszewski
body: Hey!

I have been going back and forth with it and not found much how the People type field might be configured further. The only option I am finding is to make single or multiple user field. However my automation rule does not work in both cases still giving same error.

Also regardless of the field being single or multiple user it is still not showing up on the drop down *Choose Fields to set* list.

I would appreciate if anyone can share how you managed to configure such automation around User/People type custom filled using the dropdown list of JSON.

Thanks lots!


author: Ste Wright
body: Hi [@tmaliszewski](/t5/user/viewprofilepage/user-id/4766220)

Can you clarify Mark's comment below - is this a Team-managed Project?

The field name would be *People*rather than User Picker if it is.

*** ** * ** ***

If yes, then it's not currently possible to set this field via Automation - see [this help page](https://support.atlassian.com/cloud-automation/docs/limitations-in-team-managed-projects-for-automation-rules/) for more information. The feature request for this can be viewed via [AUT-1651](https://codebarrel.atlassian.net/browse/AUT-1651)

Your alternative would be to create a **Company-managed**Project instead, where this is possible using User Picker custom fields.

Ste


author: tmaliszewski
body: Hey!

Yes my project is indeed Team-managed. That clarifies the limitations.

Thanks for pointing me into the links, very helfull!

Cheers!

Tomasz


author: Mark Chaimungkalanont
body: Is the field in question a People field in one of the Team managed project types? That field type isn't supported yet, which may explain why it doesn't appear on the list

comments: author: tmaliszewski
body: Hey Mark,

My field is a custom field defined on a project level and it is user field. Are you saying that type of field is not supported in the automation rules yet?


Tags: cloud