Forums

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

Adding multiple organizations based on asset attributes

Gerrit Wahlers
Contributor
July 14, 2025

We want to add jira organizations by adding their organizationID with a automation which are stored as asset attributes.

If a user submits a work item and chooses one or more departments in the customfield "Responsible Departments" (customfield_10384) the organizationID stored as asset Attribute "OrganisationID" should be added as organization.

I tried adding those organizations like adding request participants in this documentation: Manage Request Participants with Automation in JSM Cloud | Jira and Jira Service Management | Atlassian Support

My edit issue-rule looks like this:

{"update": {
"customfield_10002": [
{{#issue.customfield_10384}}{"add": {"id":[{{OrganisationID}}]}}{{^last}},{{/}}{{/}}
]
}
}

I got the error: "Function value has to be a number (customfield_10002)"

I added a additional protocol action to verify my input:
{{#issue.customfield_10384}}{{OrganisationID}}{{^last}},{{/}}{{/}}
returns:

211,78

What am i not seeing here?protocol.pngrule.png

2 answers

0 votes
Cyril July 19, 2025

Hi @Gerrit Wahlers , I faced the same issue and it took me hours to find that the solution is more simple when you find out that

a. Organizations (customfield_10002) does not support the syntax with"id" {"add": {"id":{{yourValue}}...
it has to be {"add": "{{yourvalue}}"} (without "id:") or else it will ALWAYS fails...

b. You can turn it any way you want, customfield_10002 seems to only support 1 single value at a time - it does not support list, arrays, etc...

Knowing this I tried the following and it worked for me (I adapted the script with your data)

1) Advanced Branching:
For each: Smart value = {{issue.customfield_10384}}
Var name = Orga

2) Edit work item (Advanced)
{
"update": {
"organizations":
[{"add": "{{Orga.OrganisationID}}"}
]
}
}

3) Re-fetch work item data <-- This one is important or else each new update will overwrite the previous value

Working as a charm for me - hope this will solve your pb 

0 votes
Marc - Devoteam
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 Leaders.
July 14, 2025

Hi @Gerrit Wahlers 

What type of field is field with id 10002?

I assume 10384 is an asset field, probably you get information like <schema_key>-1234

Add 1st some logging to the rule, to find out what kind of information your get.

Gerrit Wahlers
Contributor
July 14, 2025

customfield_10002 is the jira-standard-field "organizsations" where you can add the customer organizations.

Customfield_10384 holds the "responsible departments". if i log customfield_10384.OrganisationID i get the needed organization IDs.

Marc - Devoteam
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 Leaders.
July 14, 2025

Hi @Gerrit Wahlers 

What type of field is the field "Customfield_10384", is this an custom asset field?

What is the content of the field "Customfield_10384", if this is an custom asset field the information would be returned as "asset-1234"

The field organizations, expects an ID of the organization, this can't be an assets identifier.

Gerrit Wahlers
Contributor
July 14, 2025

Hi Marc,

10384 is a custom assetfield.

If i log {{customfield_10384}} i get META-1371036, META-1419952
If i log {{customfield_10384.OrganisationID}} i get the desired 211,78.

The question is how to pass this list of organisations ids to the organizations field.

Marc - Devoteam
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 Leaders.
July 21, 2025

Hi @Gerrit Wahlers 

Organization ID in Jira is a number, there cant be comma, dot or in the string.

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