Hello,
I have a question that is probably simple, but I can not figure it out and would appreciate the help of the Atlassian community.
It is on a JSM project.
When a work item is created:
The last part is where I struggle.
It seems to me that it should be rather simple, and that I am missing something...
With many thanks!
Céline
Edited July 15th - Additional information
Scope: JSM Service project
Aim: use the latest value provided of a custom field (WordPress Username) by a reporter that already created work items (same reporter and same "Purchase code" custom field) to populate the custom field "WordPress Username" for the newly created ticket, when this latter has no "WordPress Username" provided.
Here is a summary of the options I have explored
Why is Option B not working??
Automation Rule for Option B
Audit log for Option B
Hello @Céline - Maestrel
I have a questions about this step:
1. What type of field is the custom field?
2. Is the field into which you want to copy the data the same field in the trigger issue? Are trying to copy from field "A" in the found issue to field "A" in the trigger issue?
3. If the answer to #2 is "no" then what is the field type of the trigger issue field into which you are trying to copy the data?
4. What do you require the end result to be when you have found multiple issues where the custom field is not empty? Do you expect all the various values of those fields to be copied into the one destination field in the trigger issue?
Hello Trudy.
Thank you.
1. There are 3 fields: a URL, and 2 short-text field.
2. Yes, they are the same field "A" that I wish to copy from found issue to triggered issue.
3. I wish to take the one from the most recent issue found.
I have edited my question with more details. Thank you for asking!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the additional information.
@Marc - Devoteam provided an answer for why Option B is not working. For more information on that refer to this KB:
I believe you will need to use the Lookup Issue action rather than branching to achieve your requirement.
Use the same JQL you used in your Branch.
Follow that with an Advance Compare / smart values Condition to check that you got at least one issue back:
{{looupIssues.size|0}} is greater than 0
Follow that with an Edit action. Since this is all happening in the main line of the rule, the Edit action will apply to the trigger issue.
To set a field in the trigger issue to a value found in the most recently created issue in the Lookup results, given that you have ordered those results by Created ASC, you would reference the last issue in the results set. In your Edit action select the field you want to set, and then set it to this smart value:
{{lookupIssues.last.<your custom field>}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Yes, "Lookup items" is a straightforward way to achieve what I need. Thank you @Trudy Claspill for pointing me in the right direction, and thank you @Marc - Devoteam for your valuable input regarding Option B.
Here is my updated rule (working exactly as I need it):
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I recommend that after the Lookup action you add an Advance Compare / smart values Condition to check that you got at least one issue back:
{{looupIssues.size|0}} is greater than 0
Otherwise you may get unexpected results or an error in the following Log actions and Edit actions when no issue is found by the Lookup.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Whenever you ask for help with an Automation Rule it will help us to help you if you provide:
1. what type of project is this (e.g., company-managed, team-managed, etc.),
2. images that show your complete rule.
3. images showing the details of any relevant actions/conditions/branches.
4. images showing the Audit Log details for the rule execution.
5. Explain where the issue is.
These questions are not for not willing to help, but to have community members understand on how automation works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thank you. I have edited my question with screenshots and updated information.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are creating the variable in the branch, a branch runs parallel.
The rest of the actions in the rule, don't know this variable, if you want to use a variable like this, you will need to create it before the branch.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
Thank you for your explanation, very clear!
Can I create it before (initialize it to empty for example?) and then update its value in the branch? I will then be able to use the variable outside the branch (with its value taken from the branch)?
For my specific question, the solution was the "Lookup items", but I am glad to have now a better understanding of how to use the variable. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please accept my answer as a solution, if my answer helped to solve your request.
This will help other community member trying to solve the same.
P.S. If the answer is very valuable to you, please share some kudos.
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.