Can we use JIRA automation to run on a schedule time and extract/split 2-3 values from an existing JIRA field value and populate other fields based on that may be using javascript?
Hi @Amit Gandhi
your requirement should be met by the following rule. Please double check if this is what you were looking for.
In case of questions Community is happy to assist.
From your description I seem to have understood the field (here Business Unit) is structured the following, data should be split into BU1, BU2, BU3:
This is the rule which is doing that:
Please note: The Trigger "Issue commented" is just an example, you can choose the trigger that suits the best.
The "Edit issue fields" actions are as follows:
BU1:
BU2:
BU3:
Regards,
Daniel
Thanks.
How can we find the exact field name to be used in the script, like Business Unit in below example?
issue.fields.Business Unit.value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In case it is a cascading select field you can just use the name, like in my example.
Otherwise or if you want to understand the whole topic better, here is the corresponding documentation:
https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Will this work if BU1, BU2 and BU3 are read-only text fields?
I tried with one automation test rule in which the rule ran successfully showing field edited successfully but the field was not updated as expected.
I basically want these fields to be populated/edited through jiira automation ONLY.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I cannot imagine it would work when you try to put values into a read-only field.
This would be a bit counter intuitive even from a code's perspective.
While reading your question again I think you might be asking that you want it to have updated/edited by automation but protect it from an user editing it afterwards, manually.
Yes, this should be possible when to take the field away from "edit screen".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Daniel Ebers I am trying to solve the same issue.
I have a Single Select field
EMEA - Italy
EMEA - Greece
In your scenario i assume BU1 and BU2 are text fields.
Want to split and populate the values in two single select fields. Meaning -->
Field 1 (Single select) - EMEA
Field 2 (Single select) - Greece
Do we need to have the same options in the field ? How to approach it ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amit - can you give an exact example?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Existing field is a two level dropdown list with below values for example:
First dropdown: X
Second dropdown: Y (Z)
That means the field value as a whole is: X - Y (Z)
Now, when I run the JIRA automation rule, it should split the above values into X, Y and Z and populate another three jira fields with these values, like, say,
Field1 with value X
Field2 with value Y
Field3 with value Z
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the update.
Take a look at this previous post for some guidance. That should get you Field1 and Field2 but I am not sure how you will get Field3 since it is included in the second half (child value) of 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. However, the requirement is to have Field3 value too as I mentioned.
Is there a way to do that, like, by incorporating a custom javascript code?
Also, Field1, Field2 and Field3 are the real fields in JIRA that need to be populated for the JIRA card/ticket which is being processed, which has the value 'X - Y (Z)' for the target field which is to be extracted.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why don't you just ask for values for all three fields up front instead of only one field and trying to split them up?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We have already started planning for a better way like that, which can best fit to our system in place at present.
But again, JIRA automation, if possible as asked, can help us move the values from old two level dropdown field to those three new fields, for cards already populated in that way and can continue to use the automation in this way until the new system changes are in place in a full fledged manner.
Regardless, can you please confirm if that use case is possible or not?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would start with moving the values into the first two custom fields first following the guidance above.
Then we can look at how to parse out the values in the second custom field to the third custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would appreciate your straightforward response on the original ask if it is possible or not. Rest, we will figure out and let you know if your assistance required.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As I mentioned in my original response - I don't see how you could populate field 3. Someone else might have that expertise, but I do not.
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.