I am trying to add the team name to a jira issue via automation since the field is not available in the Issue Collector.
I have tried adding this to the automation rule, but this did not work. I am sure it's not difficult, I hope, but I cannot figure it out. Thanks in advance for your help.
{
"fields": {
"Team": "1080",
}
}
As Jira has several things named "Team" I recommend using the custom field id in that JSON expression.
You may find the correct value using the how-to article linked below. Essentially you identify an example issue with your field, call a REST API function to see all supported fields, and then search on the page to find your field's smart value and custom field id.
https://confluence.atlassian.com/automation/find-the-smart-value-for-a-field-993924665.html
Kind regards,
Bill
@Bill Sheboy Thank you for responding. I tried using the following JSON but not sure I wrote it down correctly as it's not working. I get a failed message each time. The following fields should be filled out (below) in addition to the Team field. I have tried using the team id as well as the team name. Still not working. Would love the help!
{
"fields": {
customfield_10101: "1080",
}
}
{
"fields": {
customfield_10101: "DTO - Systems Engineering",
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am also trying update / set and it's no working. For example:
{
"update": {
"customfield_10101": [{
"set": "DTO - Systems Engineering"
}],
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think the error could be caused by one of two things: a trailing comma or the incorrect syntax. Please try one of these:
{
"fields": {
"customfield_10101": "1080"
}
}
Or...
{
"fields": {
"customfield_10101": { "id" : 1080 }
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy Thank you... I really appreciate your help troubleshooting!
Unfortunately that didn't work either. I copied directly from your response.
I've tried using the customfield_10101, "Team" as well as "1080" and the actual team name. No luck.
I have faith in Jira that I can do this, but I am not a JSON expert by any means.
Should I put the JSON in its own "Edit Issue" component so it's standalone? I found that if I add too many fields into the component, then they don't update the jira issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmmm...I wonder if there is a different issue related to your rule structure.
Would you please post an image of your entire rule, and include an image of the edit issue action?
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.
Yes, that helps; thanks!
When you edit an issue in a rule, particularly the trigger issue, it is using the current conditions at the time the rule was triggered. If you want to include the latest edits, each edit must be followed by the Re-fetch Issue action to reload the information before the rule proceeds.
Because each call to Re-fetch Issue can add about one second to run time, it helps to consolidate your edits to one action, when possible. Let's try that first.
If you have multiple edits requiring JSON, let's look at how to merge those into one action also.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried to have Label, Classification, FixVersion, Epic Link and the JSON in one component, but when I created the issue via Issue Collector, everything but the Epic Link was missing. That's why I split it out. I had 2 fields in a component and that worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is curious...I wonder how that manifests in the rule execution differently for ones created by Issue Collector.
There is a known behavior that the Issue Created trigger can occur so quickly that other data is not available for the rule to use it. And, subsequently your edits could be "walking over" each other and other saved data!
The work-around for that is to *always* put a Re-fetch Issue action immediately after the Issue Created trigger. Perhaps try that, and then merge all of your edits to one action and observe the results.
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.
There is a rule action named Re-fetch Issue: https://confluence.atlassian.com/automation/jira-automation-actions-993924834.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you. I added that just before I send the email. Is that the correct placement?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, that worked.
Still open issue about that silly Team field!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Would you please post an image of your current, complete rule...including details of the action to set the team? Thanks!
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.
You are missing 2 calls to Re-fetch Issue...
Add one immediately after the trigger, and before the condition test
Add another after the first edit issue action.
So the rule will look like this:
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.
So like this? ^^
but what about the Team field? Its crazy that it's not there when it's out of the box on Advanced Plan - is that because it's a 3rd party or a plugin?
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.
My understanding is many of the fields in Advanced Roadmaps are not supported by APIs that automation rules use.
I am glad to learn you have all the fields working now. Do you consider this one solved?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
still cannot populate my team field, which was my original question. :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for clarifying. When you used that how-to article to find your field's smart value, did you find it?
That is, for your example issue you tried did you see a smart value and custom field id for it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Honestly, I couldn't figure out what I was supposed to use or how to write the JSON.
Looking here:
Jira smart values - issues | Automation for Jira Data Center and Server 9.0 | Atlassian Documentation
Would I use the issue.CustomField.10101 or issue.CustomField.team?
{{issue.CustomField.id}}
Should the JSON in the component read:
{
"field": {
"{{issue.customfield.10101": "DTO - Systems Engineering"},
}
Again, thank you so much for your help! I really appreciate it. I would rather use this than the Confi forms since it's less confusing. Well, except this part!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Once the rule is editing a field with JSON, you only reference the field name. Please try this:
{
"fields": {
"customfield_10101" : "1080"
}
}
You noted the value "1080" earlier, so if I have that incorrectly noted, please replace it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FINALLY!!! that worked! OMG thank you thank you thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I swear I tried that before, but wonder if the Re-Fetch helped? Anyway, I am very happy it worked. Thank you so very much for all your patience!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nope, looks like my mistake as I left off the quotation marks around the field name on the left-side of the JSON. (I will update that earlier post.) Sorry about that, and I am glad to learn it is working now.
If it is all working, please consider marking this one as "answered" so others can find solutions to related needs. Thanks!
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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.