How do I pull people from groups and add them to a custom field?
Example:
Group: team_support
team_support = Troy, Ian, Gaven
Multi User Custom Field: "Support Members"
team_support -> "Support Members"
"Support Members" = Troy, Ian, Gaven
Workflow Post Function?
Add on?
Thanks!
Ian
@Alex Christensen Yeah we have both ScriptRunner and Automation for Jira. If members change in groups, no problem. Just need jira to pickup new group members with new tickets, not existing or constant update (although would be nice and more automated).
What would you suggest we do here? Can you break it down for me? :D
For more context: we are trying to automate approvals in Service Desk by pulling people from AD groups. Accomplishing this would be a HUGE game changer for us.
Thanks,
Ian
This is definitely not possible out of the box in Jira. A few options you might want to explore:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ian Johnsen for a ScriptRunner workflow post-function, try something like this. I haven't tested this code, but it's a start for you.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
// get group manager and user group
def groupManager = ComponentAccessor.getGroupManager()
def groupUsers = groupManager.getUsersInGroup("team_support", false) // false is used to not include inactive users
// get custom field for multi-user custom field
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def supportMembersField = customFieldManager.getCustomFieldObjectByName("Support Members")
// set custom field value
issue.setCustomFieldValue(supportMembersField, groupUsers)
// update issue with changes
def issueManager = ComponentAccessor.getIssueManager()
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
issueManager.updateIssue(currentUser, issue, EventDispatchOption.DO_NOT_DISPATCH, false)
I also found a few related examples for you in case you want to look at those, too:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.