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>
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`.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.