Hi everyone,
I have the following problem:
I am dealing with an issue type that involves subtasks, and I need to copy the value of a specific field from each subtask and consolidate them into one field in the main task.
The fields represent users from our company and offer multiple choices.
For example:
Subtask 1 - Field value: user1, user2, user3
Subtask 2 - Field value: user4, user5
Subtask 3 - Field value: user6, user7, user8, user9
Main task - Field value: user1, user2, user3, user4, user5, user6, user7, user8, user9
Hello @Lusine
Hi @Kalyan Sattaluri ,
Thanks for responding.
I require several employees to provide the names of the users from their respective directorates.
It will help a lot if you could help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your response. Few more questions.
Just FYI for future steps- we may need to know the customfield value of this field if referencing the field name does not work. But we will get there that comes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No problem, Thanks 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.
OK, Please see below screenshot. In your automation, in any rule, after your trigger step, you get an option to choose action, if condition etc. Choose action and once in, check to see if you have lookup Issues action available.
Since you tagged this as Data center, your company needs to be on latest version since this functionality was released recently. So please confirm if you have below option..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, our company's version is not the latest one.
Perhaps there is a plugin that I can use?
I have an issue type where the subtask comments are transitioned to the main task. However, in this instance, I need it to be a list of users and to avoid any overlap.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hmm. So we need to check if all sub-tasks are done or not, for that, if lookupIssues is not available, let me check if we can do this using smart values... if thats not possible, another option is to send a web request to gather this info.
So give me some time to check if its possible to implement this rule simply.
----------------------------
In the mean time, can you check if you have access to create token.
Can you go to your Jira settings, by clicking your icon on top right, click profile, on the next page, select personal access token tab and see if you see an option to create a PAT on top right. Please see below link on same steps.
https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html
If you can get this token, then this is our back up, may involve some new steps you havent done but will get the job done. Let me know if you can create Token.. While I check if we can get it done in a simple way.
------------------------
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think we can do this without web request step.
See below screenshot.
We are not updating the Parent issue yet. We are making sure logic works.
After setting up the rule, trigger it by taking an issue which has 2 subtasks. Transition both 2 done. Share with me the latest Audit log (see yellow highlighted section) along with the rule. I need both screens to understand progress.
If above logic works, we will update the parent. Let me know if any questions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot for your help.
I did as you said. Here is the screenshot.
This part is a success, what should I do for the part of the main task?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Lusine
As you can see, the last log statement did not print so we need to correct it.
Can you use below smart value to log instead of earlier one and share screenshot of audit log once again.
{{triggerissue.parent.subtasks.Participants.displayName}}
Also, because you dont have "variable" option of newer Jira, we need to temporarily store participants info in a field before we can update Parent field..
Do you have a "Text" field in your parent which you dont use? Because we will overwrite whatever is in that field with our list and remove it when we are done with updating participants list.
So please take a look at your Parent issue and see if there is any such field we can use. If so, please share the field name and I will share rest of the rule.
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.
Do you have a text field in your parent which you dont use? We need to store this info temporarily before we update the Participants list..
Can you take a look at your issue fields and let me know a field name we can use. If you are not sure, we have an alternative.. but this will be the easiest..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I have a "Description" field. It is a multiline text field.
But I'm going to open other subtasks for the users that are transferred. Can I do it from that multiline text field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, Description is a common field which honestly I dont want to use.
See if you have any other custom fields which are text type when you go into edit..
If not, we will store this list in issue's entity.. So we have a backup if you dont have one.
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.
Hi @Kalyan Sattaluri ,
I'm sorry for taking so much time from you. But I feel like we're almost done.
This far everything is working what should I do next?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Lusine
I thought you were going to give me a name for the field we can use.
Lets assume, "Text 1" is this field and I will give you the steps.
After your branch,
{{#triggerissue.parent.subtasks}}{{Participants.name}}{{^last}}, {{/}}{{/}}
{{#triggerissue.parent.subtasks}}{{Participants.name}}{{^last}}, {{/}}{{/}}
{ "fields": { "Participants": [ {{#Text 1.split(",")}}{"name" : "{{.}}" }{{^last}}, {{/}}{{/}} ] } }
Above step updates the field so we are good, we need to clean up the Text 1 field, so we choose edit issue once again choose Text 1 from drop down and in the value to assign, give it {{clear}}. That will wipe the value we assigned earlier.
Please see screenshots below for reference.
Please make sure you log values as I have and shar3e your audit log if issues.
Please update your "Title" of this post to -- "Update Parent issue with Sub-Task values without lookupIssues}} so its relevant and helpful for others in the future when researching.
Please accept answer once its working so its beneficial for folks in future.
Thanks!
Screenshots for reference from Branch onwards.
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 must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Lusine
First thing, I am using Jira Cloud, not Jira Data Center, and so cannot test the suggestions I offer. They are based on what I know about automation rules, in general. With that out of the way...
I believe there may be two ways to solve this. Let's check the easiest one first:
Issues have the subtasks smart value: {{issue.subtasks}} However, that may not include all of the data for each subtask, such as your user field. The way to check that is using this how-to article, looking at an example issue with subtasks which have the user field set, and observe what you see.
https://confluence.atlassian.com/automation/find-the-smart-value-for-a-field-993924665.html
If you see the data for the users, the rule could use an iterator and advanced edit with JSON to add the users to the parent issue.
If the users were not visible for the subtasks, you can use the REST API to perform an issue search to load the subtask, and then use the same iterator and advanced edit technique on the results.
FYI, with Data Center, rules also have the Lookup Issues action, but I do not believe that has custom fields yet and so it will not help this scenario.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Bill Sheboy ,
Thank you for your reply. I'm trying the way suggested below. But thanks a lot for your support.
Best regards,
Lusine
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.