Hi,
I have two fields of over 600 options, and I want to run automation to fill out the second field with a value that is in the same position in the first fields list.
For example:
Custom Field One Values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10....600
Custom Field Two Values: A, B, C, D, E, F, G, H, I, J...ZZZZ
I would want it to match up based on the position of each list like this:
A|1
B|2
C|3
D|4
E|5
Can that be done through JSON? Or is there any other method to add this in without manually entering over 600 automation rules?
It should be possible to get the value by using the Send web request to the REST API to get the value for the second field. You can find the API call to use here.
Thanks Michael,
That seems to solve half the issue (getting the Values quickly), but is there a way to make it update the second field in the manner I mentioned (so contextId1 of Field One adding contextId1 to Field Two)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, if you wait for the result to come back from the web request, you can get the value for the specific position and then use a smart value to set the second field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Really sorry Mikael, this is very new to me and I don't really understand what you're saying.
Within the Automation page itself, if I go to Send Web Request, I can see where to enter the URL for requesting, but beyond entering; https://your-domain.atlassian.net/rest/api/3/field/{fieldId}
I am at a loss as to what to do next to make this happen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No worries Chris, we have all been there.
So the URL needs to contain the fieldID and the context ID, you can get both of these either from within Jira if you go to administration > issues > custom fields, or your other option is to get it via REST API. Once you have those two IDs you will also have to add two headers, one for "Accept: application/json" and the second one for the authentication, something like this "Authentication: Basic <username:token>".
The returning result from that request can then be used to find the corresponding value and be used to set the field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Mikael,
Will I need to run this twice in the same automation rule? Once for each field?
And then with regards to how I set that second field (because the values are different not the same), what's the step I would have to take there? Like I said there's over 600 in each field, so I am hoping it is as simple as saying Value in position 1 in Field One should equal value in position 1 in Field Two etc...
Is that what will come out of that result?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, you would have to run it twice, one for each field.
Instead of using automation for this I would probably go with an external option, you can then use two lists to map the values from both fields.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I already have a CSV with both fields values lined up correctly of that is of any use?
That's how the fields were imported to begin with.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It does, if you use an external option to set the second field. Then you would just need to get value for field one, look it up in the csv, and send an update request back. Automation can only part of this, so you would have to rely on something like tray.io to do the lookup and either send the value back to automation, or set via a api call.
I have sort of a similar workflow going, were automation triggers a workflow in tray.io to look up a reporter's manager in Okta and then return that value to the automation that then sets a manager field in Jira.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's great. Thanks for all the help Mikael, I will have a look. Anything that avoids me needing to setup 600 Automation rules!!
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.