Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to create a change via powershell but I can't get the custom array parsed right

Vanessa.Fraser
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 3, 2025

I am trying to automate our monthly dev and prd patching change tickets via powershell.  I have all the fields except the Approvers (customfield_10313) entries working.

I've tried every variation I could google and copilot suggested but I'm missing just the basic how to make it an array syntax.

I can find a lot of articles about it but rarely run across one where it uses powershell and I have to use that for our Jenkins nodes to do the work.

My xml looks like this: 

<cutsomfield id="customfield_10313" key="com.atlassian.jira.plugin.system.customfieldtypes:multiuserpicker">

<customfieldname>Approvers</customfieldname>

<customfieldvalues>

<customfieldvalue>

<![CDATA[ ug:7a936bb1-2c88-4218-bc67-c8468ec7da19 ]]>

 

</customfieldvalue>

 

<customfieldvalue>

<![CDATA[ ug:0fe33682-589b-4a09-9e4e-eeaa6b23b1b0 ]]>

</customfieldvalue>

</customfieldvalues>

</customfield>

 

1 answer

0 votes
Mercy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
December 10, 2025

For Jira Cloud, multi-user picker fields must be passed as an array of account IDs in the JSON payload, not as XML or legacy `ug:` identifiers. The field you’re targeting (`customfield_10313`) expects a list like `"customfield_10313": [ { "id": "accountId1" }, { "id": "accountId2" } ]` when calling the Create issue REST API. In PowerShell, you can build that structure with `@{ fields = @{ customfield_10313 = @(@{id="accountId1"}, @{id="accountId2"}) } } | ConvertTo-Json`.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events