Hi all,
I'm trying to assign newly created bugs, to the guy who worked on the feature. To do so, whenever a link between bug and feature is established, I check the feature assignee and try to apply it on the bug.
A feature might have passed several departments - dev, design, localization, etc. So I have a hidden custom field that picks up every single assignee. When the bug gets linked, I get its component and compare it to the groups each assignee is part of. If they match - I got my department and exact person who needs to be assigned.
Example:
The issue is when I do advanced branching:
I manage to find the correct assignee, but I'm unable to assign him the bug. {{loopAssignees}} returns the user ID, but JIRA does not recognize it:
{
"fields": {
"assignee": {
"id": "{{loopAssignees}}"
}
}
}
Any suggestions on how to achieve this? Both on the overall logic, or specifically on how to get JIRA to understand that {{loopAssignees}} is a user ID?
Thank you!
Hi @Boyan Iliev
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.
Sure, its a company-managed project.
Here is the problematic part. Trying assignee outside this branch works. Within it - no.
Actually hardcoding last step also works, but I don't really want a hardcoded assignee:
{
"fields": {
"assignee": {
"id": "5c2dcac...."
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Boyan Iliev
Have you confirmed your variable does not contain any leading / trailing spaces?
I think this might be the issue.
You could try the following option in the edit {{loopFEUsers.trim}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I haven't, the result is different, but still no assignment:
Out of desperation I was trying .toString, .toJSONString etc etc as I thought JIRA does not recognize the variable value as string...nothing really worked - all returned empty result like the trimming.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At some point I was trying to get the index of the item that matches my criteria and after that - outside the branch do something like {{issue.customfield_11747.get(<index>)}}, but this also was a dead end.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Boyan Iliev
Reviewing, you log actin shows that the variable contains a ";" behind the account ID, this needs to be removed in a way, as this is not part of the account ID.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Boyan Iliev
Would you please show images of your entire rule (in one continuous image) and the audit log details for the entire rule's execution? Those may provide better context for this scenario.
Until we see those...
I recommend using the Assign User action with the accountId as a variable / smart value for this scenario rather than the edit.
And, I hypothesize you are either hardcoding the "team" list as Created Variables, or populating those team list variables by calling the REST API endpoints and checking groups.
If there is a variable with the list named {{feTeam}} and your {{issue.customfield_11747}} is a multiple-selection user field, you could find the overlapping values using methods described in this article I wrote to use the match() function with regular expressions rather than using the Advanced Branch:
And...please remember to add handling to check when no overlaps (i.e., matching user in the team) is found.
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.
This is the core logic, the rest are If/else statements to handle different components/teams, validate there are no assignees, finding out if the trigger is the bug or the task (was the link done in the task or in the bug) etc.
Yet, you are right that I've hardcoded a {{feTeam}} for simplicity. Moving forward I'll try to pick it up dynamically from the actual JIRA group (probably REST API ). Either way, match() sounds like worth a shot. I'll test and let you know.
I don't care about overlaps :) If 2 people from the same domain worked on it, assigning to either one is fine. And if I don't find an assignee, the bug will remain unassigned and picked up manually...by me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perhaps I did not explain that well...
When you have a list of historical assignees and a list of people on a team, you can use the "overlaps" technique to find the person to whom you want to assign. That would eliminate the looping and most of the conditional logic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, this makes sense. I did a quick test, but something is off in my setup.
Let me get back to it on Monday and I'll post results.
Worst case - I'll make a new custom field per department. It will be ugly, but simple :)
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 , I cant get it to work for some reason.
My assignee list is actually already "joined", wiht a separator of ", " as I define it like:
but when I do
{{issue.customfield_11747.match(feTeam)}}
the result is empty. And I know that one of the people in the list match the above variable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are trying to use the list of values as if it is a regular expression in the match() function , and it is not one. Please take another look at that article I wrote for more details.
Assuming your variable named feTeam contains what you show, and is delimited by comma-space between values, you could create the expression with another variable:
Then to find any matches within the custom field, use this:
{{issue.customfield_11747.match(varRegEx)}}
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.