Dear all,
Please I need your help to set a global automation, I´m several days trying but I cannot find a solution.
I have two projects: P1 and P2
Whenever a P1 ticket is linked to a P2 ticket, the name/text in "Organization" field in P1 must be automatically added as "Label" field in P2
Thanks
It has been a couple of days, but have you been able to get this working?
If not, let's start with confirming this: what is exact name and type of your field?
Is it the locked JSM field 'Organzations'? Or some custom field? If it is a custom field, please let us know what the type of field is.
Have a nice day. Rik
Hi Rik,
I still not been able to set it properly, "Organizations" is the locked JSM field, it is not a custom one.
Just to resume again my scenario, maybe I explain it wrong:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have create a new automation:
I will let you know if it works
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It works !!!
Thanks a lot for your help, really appreciate it
Merry Christmas !!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As already mentioned here, we might need a bit more information to help you with this.
But making some assumptions, this might help you. Let's assume you are using Jira Service Management and the field you refer to is the Organizations field which represents the Customer's organization.
If that is the case, you will need to use a Smart Value to extract the Name of the Organization. In addition, you will need to remove any spaces from the Organization name, since labels cannot contain any spaces.
Following these requirements, this will be your smart value:
{{issue.Organizations.name.replace(" ","_")}}
So in your automation you will have something like this:
Hope that helps.
Have a nice day,
Rik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rick,
Your scheme is pretty similar to mine:
1. Trigger: When value chnges for "Organizations"
1) Condition: Project equals to P1
2) Condition: Linked work item present Types: All link types
2. Branch:
1) For Linked work items
Types: all link types
2) Condition: Project equales to P2
3) Action: Edit work item fields: "Labels": {{triggerIssue.Organization.toLowerCase()}}
I have also tried with: {{triggerIssue.Organization}}
I will also try to apply your recommendations to see if I make it work
Thanks a lot for your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Adrian Moreno Vargas
I like to use the Log action in rules to print smart values into the Audit Log when the rule executes. That way I know what value the rule is getting from those smart values. Example
One thing I notice is that in your information you said you are using "Organization" in the smart value, where @Rik de Valk _Brainboss_ is using "Organizations". If you don't use the correct field name then your rule cannot get the value, and it will not tell you that your field name is not correct.
The other thing to note is that Organizations if a field that stores multiple attributes such as id and name. As Rik showed you may need to reference the .name attribute specifically to get the name vs. the id number for the value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trudy,
Thanks a lot for your help
The Smart Value I added in Values to add field in my new automation is:{{triggerissue.Organizations.name.replace(" ","_")}}
Values to remove I leave it empty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Excellent. That is the smart value that worked for me, when I tested this.
{{triggerIssue.Organizations.name.replace(" ","_")}}
The replace spaces with underscores is important when trying to add labels, because labels cannot have spaces.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rik !!!
Totally confirmed, that Smart Value works :)
Thanks a lot for your help
Merry Christmas !!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Without seeing your automation, the following should work:
trigger on 'Work item linked'
add first condition to be either field based on jql based: project = P1
add second condition for linked work items of all link types that match jql: project = P2
add THEN step: create variable (orgname). specify smartfield corresponding to your Organization field
add branch for Linked work items - all link types
add THEN step into the branch: Edit work items field. Select 'Labels' field with SET condition and in Additional Fields specify the code below
{
"update": {
"labels": [
{ "add": "{{orgname}}" }
]
}
}
good luck
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Artem,
My last version of the global automation is:
1. Trigger: When value chnges for "Organizations"
1) Condition: Project equals to P1
2) Condition: Linked work item present Types: All link types
2. Branch:
1) For Linked work items
Types: all link types
2) Condition: Project equales to P2
3) Action: Edit work item fields: "Labels": {{triggerIssue.Organization.toLowerCase()}}
I have also tried with: {{triggerIssue.Organization}}
I will try to apply your modifications and see if it works.
Thanks a lot for your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you definitely need to store org from P1 as a variable
the syntax of the Additional Fields instruction might need some modification
Project = P2 condition probably makes more sense on the branch than where I've placed it on the trigger
try adding the variable creation step only into your automation and replace Edit Work item step to apply the variable using JSON via Additional Fields
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Artem,
Finally I make it work modifying the Smart Value, up is the automation sequence I used.
Thanks a lot for your help
Merry Christmas !!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do not think something like this can be achieved using automation. Extracting a field name and use as a label. But am curious to see if something like this can be done.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Varsha,
I have tried everything, many different oprions by myself, with IA support, some old colleagues also try to help me but I still do not get possitiv results, this is my last option to make it.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adrian - Welcome to the Atlassian Community!
Please post a screenshot of your rule and let us know exactly where the rule is failing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Adrian Moreno Vargas
In addition to the information @John Funk requested, please tell us the types of projects/spaces for P1 and P2. Are they Software, Service, or Business projects/spaces? Are they Company Managed or Team Managed?
You can get that information from the Type column on the page that lists all the projects/spaces.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Trudy,
P1 is a Service management
P2 is a Company-Managed software
Thanks a lot for your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
Thats the Smart Value i used to finally make it work.
Thanks a lot for your help
Merry Christmas !!!
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.