Good Friday good People :)
I've created a Custom Field (with good help from the people at this forum ;) ), called Reporter Group, and that field is automatically filled out by Reporters User Group when an issue is created.
I ran into some issues to begin with, cause some users are in more than one group but got a solution to that. The reason for me doing this, is because I wanted to be able to see in a pie chart what group is reporting most / fewest defects.
I've put the script below so you can see how above mentioned it's done... BUT... now I'm wondering if I can change the script to set the Reporter Group field by an IssueType, for certain User Groups. For an example if a user is in two groups that I don't want to ignore, then the issuetype sets the field.
Fx. If I'm a reporter in two groups, one called jira-techsupport and another called jira-servicesupport, and if I report an issutype called techsupport, the reporter group is filled out as jira-techsupport, but if I report a regular bug (or something else than techsupport issue) the reporter group is filled out as jira-servicesupport, and this only applies if user is in those two groups, not he's in 'jira-qa' group etc.
Here is the script I'm using now, and works well, but would like to add the issuetype as mentioned above to it.
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.security.groups.GroupManager
GroupManager groupManager = ComponentManager.getComponentInstanceOfType(GroupManager.class)
GroupList = groupManager.getGroupsForUser(issue.getReporterId()).name;
ignoredGroups = ['jira-users', 'jira-administrators'];
resultGroups = GroupList - ignoredGroups;
return resultGroups[0];
Best regards
Kristín
You can get the issuetype with
issue.issueTypeObject.name
Henning
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.