I am trying to use Service Desk's Organizations field to help populate my "Customer" field in Jira Cloud by automation.
When I try to set the automation rule, Organizations is not an available field for me to copy the value from.
Hello @Taryn Lachter
What is the field type for your "Customer" field?
Are you working with a Team Managed project or a Company Managed project?
Can you show us a screen image from the Automation interface showing us where you are trying to select the "Organization" field?
The Customer field is a dropdown that is sourced from a manually managed list of values within our settings. This is a Company Managed project, we don't have team-managed projects.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Taryn Lachter
If Customer is a Selection List type of field, then you may not be able to copy directly to it from the Organizations field as they are not the same type of field. You may have to use the More Options area to copy the data using JSON code.
What information do you have as options for your Customer selection? Are you populating that with the names used for your Organizations?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried using a smart value for the Organizations field {{issues.organizationName}} but that didn't work either. Organizations is a native Service Desk feature where you create each one individually, it doesn't come from a list. The names are the same and spelled the same but they technically are not the same values according to the system.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There are multiple debugging techniques you can use to try to figure this out.
1. Use the Log action to print the value of the field into the rule execution log. I did that and this is what I got:
Organizations is a special type of custom field that has multiple attributes within it; id and name.
If you want to use the name of the Organization to specify the setting of another selection list that has items with matching names then I would try using JSON.
{
"fields": {
"your_custom_field": {"value":"{{issue.Organizations.name}}"}
}
}
I based that on looking at this example for how to use JSON to set a single select list custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This beyond my capabilities and understanding. I am going to ask Jira support for help. I appreciate your assistance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hm, I provided an additional explanation, but it seems like I did not save it.
I am happy to try to provide more information.
When you use the Copy From option to update a field, the list of fields to copy from will include only the fields that are the same field type as the field you are trying to copy to.
Your destination field is a Dropdown type of field. That means your list of fields to copy from will show only other Dropdown type fields.
The Organizations field behaves like a dropdown field, but it actually is a custom field type called Organization. Therefore it does not appear in your list.
In such cases you can use JSON code to get the value you want from the Source field and set the Destination field.
In dropdown style fields each option has an ID and a Name/value. The Name/value attribute is the text that you see when you look at the options. In your case you want to match the Name of the Organization to the Name of an option in your destination field.
{{issue.Organizations}} by default will get the ID value of the selected option in that field. To get the Name value specifically you append the .name syntax.
{{issue.Organizations.name}}
To indicate through JSON that you want to set your Dropdown field to the option whose name matches what you got from the Organizations field, you use syntax to say you want to set the "value" of the destination field.
{
"fields": {
"your_custom_field": {"value":"{{issue.Organizations.name}}"}
}
}
Replace "your_custom_field" with the name of the field you want to set.
You can learn more about editing fields with JSON code here:
https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/
To provide that JSON code click on the More options link in the Edit Issue action. That will show/hide the dialog for entering the JSON code. It will initially show sample code, as shown in this image.
When you are editing a field using JSON code, you need to make sure that the field is deselected from the Choose fields list. You can't edit the same field from two places in the Edit action.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Trudy Claspill for your very detailed explanation. I have tried multiple times and am still unable to get it to work, I am not a coder so this is pretty far outside my wheelhouse. I will ask Jira Support to help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not sure if helping create Automation Rules is within the scope of support provided by Atlassian, but it doesn't hurt to ask.
If you post new images of your Automation Rule and the rule execution log, we can try to advise you on the specific changes you need to make.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Taryn Lachter
Did you get the help you desired from Atlassian Support?
If you have been successful in getting a solution implemented, can you please post the details here to benefit others in the community?
If Atlassian Support has been unable to assist you and you still need a solution, please post images of your current rule and I will continue to try to assist you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trudy, I never received a response from the support team and have not figured this out completely yet.
Here is the rule so far
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have one left curly bracket too many.
Try removing the one at the end of the 4th line:
...name}}"}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Trudy. I did try this and it still is not auto-assigning.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Taryn,
I did some experimenting.
There is a simpler way to handle this. But first...
The Organizations field can have multiple values set in it. Do you ever set it to more than one value? If so, what would you want to happen in your Customers field? Is that field a single selection field or a multiple selection field?
If it is a single selection field, and if you might have multiple values in your Organizations field, then you need to pick just one of those values to "copy" to your Customers field.
This is how you can accomplish your requirement. It worked when I tested it.
In your Edit Issue action, first delete all the JSON code that you added in the More Options section. You are not going to need that.
Next from the Choose fields to set list select your Customers field.
In the input field for your field type in what I've shown below. As you type that text, the Smart value... text will display below the field.
When you finish typing in the value click on the Smart value '{{issue.Organizations.first.name}}' text. That will insert the text into the entry field.
Save your rule.
A rule like this has run successfully and updated the selection list field in my environment. I tested against a Company Managed Service Management project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trudy, thank you for this information. My organizations field is a single select, and it usually happens automatically by service desk based on the reporter's email which we've manually added to each organization. The customer field can be multi-select but in the case of organizations, only one would ever be chosen and our expectation is that it would match the customer.
I tried this solution and it did not work. I'm now wondering if it has to do with how my customers are written so I'm going to evaluate my customers list and make sure they match.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
that fixed it! thanks again for all of your help Trudy. I appreciate your follow up here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great! I'm glad we were able to help you get to a solution, even if it took us a while.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.