Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Using a smart value to add an organisation to a ticket


I have a value stored in a smart value lets say "ABC Company".


Using Project Automation, I want to set a ticket's organisation to this value (I will ensure there is an organisation called "ABC Company").


It doesn't appear to be supported the simple way so I'm keen to hear some more advanced solutions.





edit org.PNG


2 answers

1 accepted

2 votes
Answer accepted

Managed to get this working with the help of Atlassian support.

For posterity, the method:


Use the "send web request" in automation, post custom webhook data:

"name": "{{smartvaluecontainingmyorgname}}"


Then Edit issue, advanced:

"fields": {
"Organizations": [{{}}]

Alex Community Leader May 11, 2021

Hi @Oliver 

This solution is pretty neat and will solve my case as well.

Could you share an example of the Webhook URL to send web request ? I did not manage to identify what is the API that provides the organization data.



Hi Alex


I'm glad you found this helpful - it took me a lot of effort to get this working!


The fields I am using are as follows:

Webhook URL: "https://[myjiradomain]"

Headers box 1: "Authorization"

Headers box 2: "Basic [myapitoken]"

HTTP Method: "POST"

Webhook body: "Custom data"


I hope this helps.




Alex Community Leader May 12, 2021

Thanks, @Oliver, it worked perfectly!

A simple addition based on my use case. Since I am using JSM Data Center, this API is still experimental, thus another header was required.


Headers box 3: "X-ExperimentalApi"

Headers box 4: "opt-in"

Amazing solution @Oliver It shouldn't be this hard but since the organisations field doesn't seem to work like any other fields it's no suprise this is required.


One thing I need to add after almost a year of changes: the name "webhookResponse" is "webResponse". Also, remember to check the box that says to wait until a response is received to move to next steps. Otherwise you will just have an empty body.

Like Artem Chatlikov likes this
0 votes
Dirk Ronsmans Community Leader Sep 18, 2020

Hi @Oliver  and welcome to the community,

I've take a look and tried some thing and here's what I came up with:

Instead of setting the field through the UI you can go to the Advanced portion of the Edit Issue and create a JSON Payload.

To set the organization that would be:

"fields": {
"Organizations": [4]



This will add organization with id "4" to the issue.

The id you can get from the url when you open an organization:

for example with me: ]/jira/servicedesk/projects/ISD/organization/4

So for one I think you would need to store the Id of the organization that you want and not the name.

Then you can use the smart value system to get the value fro mthe custom field:

{{issue.YOURCUSTOMFIELDNAME}} (and replace that in the JSON)

There might be a cleaner method of "adding" cause there should be an operation you can give:

 "name": "Organizations",
"key": "customfield_10002",
"autoCompleteUrl": "/rest/servicedesk/1/organisations/project/10003/search?query=",
"hasDefaultValue": false,
"operations": [


but the idea is that using that advanced portion you basically send a payload like you would in a REST call  (cause thats probably what it is) but to a predefined endpoint to edit the issue.

Hi Dirk


Thanks for the response. This may work if there is a way to convert an org's id from it's name? I only have the name available in my smart value (I'm parsing it from text).



Hi @Oliver ,

I'm afraid not, your smart value is essentially just text so it has not attributed to pull from. As far as i can see there is also no way to parse the textual value to a id in Automation. (using a script you'd probably could just do a GET of the organizations and see their ID's)

The only way my 8am brain can come up right now is to use a hardcoded conversion and that works depending on the amount of organizations you have and how often then change.

I tried it also in the other formatting but without any luck on text. the add operation just expects a number parameter.

"update": {
"Organizations": [{
"add": 4

Imo, you could either:

1) Create a 2nd automation that is basically a collection of IF statements that updates a helper field (e.g. OrgID) that at creation converts the textual organization to the id.

And then use that OrgID field change in your initial automation to set hte correct ID from that smartvalue.


2) Add these if's in your original automation and hardcode the id in to your json update.


neither seems to be a great solution and depending on the amount of organizations i would go 1) (if you have a lot of them so you can do the ID maintenance in one place) or 2) just to have a single automation.


Sadly the only way this will be different is when you can pass a textual representation of the organization to the call (or run a small script in your automation). I understand Atlassian's point of view here so that when you change the organization name the ID remains the same.

If you don't find either solution works for you I can only suggest to open either:

Move to something like Scriptrunner so you can do the GET first and then a PUT to set it and have more control.


Open a call with Atlassian (as they own the Automation part now) to see whether they add some component that allows you to add small scripts..

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

An unofficial way to monitor a JSM mail handler for errors

...eturns true if any content is returned for the s...

655 views 3 19
Read article

Atlassian Community Events