We would like to see on the ticket what groups the report of a ticket belongs to. What would be the best approach?
Tried looking at API but it doens't look available.
Hello,
You can use the Power Custom Fields add-on. It is a free add-on.
You can create a field with the following script:
return join(userGroups(reporter), ",");
Thanks! Although, free add-ons usually become paid add-ons or is discontinued. We have Script Runner.
But if you know how we can get that from API that would be awesome!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It would be like this:
import com.atlassian.jira.component.ComponentAccessor
return ComponentAccessor.getGroupManager().getGroupsForUser(issue.getReporter())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are welcome!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried this, but didnt get the result. I am getting something like::
[com.atlassian.crowd.embedded.impl.ImmutableGroup@5ab0a9b9, com.atlassian.crowd.embedded.impl.ImmutableGroup@aa6f0adf, com.atlassian.crowd.embedded.impl.ImmutableGroup@1845f18a, com.atlassian.crowd.embedded.impl.ImmutableGroup@86a, com.atlassian.crowd.embedded.impl.ImmutableGroup@7403ff3, com.atlassian.crowd.embedded.impl.ImmutableGroup@e239b761, com.atlassian.crowd.embedded.impl.ImmutableGroup@42b66b45, com.atlassian.crowd.embedded.impl.ImmutableGroup@9099bd68, com.atlassian.crowd.embedded.impl.ImmutableGroup@852dcdc5, com.atlassian.crowd.embedded.impl.ImmutableGroup@976d6f29, com.atlassian.crowd.embedded.impl.ImmutableGroup@95a62d82, com.atlassian.crowd.embedded.impl.ImmutableGroup@ca5d9308, com.atlassian.crowd.embedded.impl.ImmutableGroup@58e3f5fa, com.atlassian.crowd.embedded.impl.ImmutableGroup@2d90ea2a]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if you have Scriptrunner, maybe you can use a scripted field, that gets the information from the reporter and displays it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes. I'm just having trouble getting it. Is it
userUtil.getGroupNamesForUser
?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did that once, but do not have the script at hand. It was something like Alexey posted, so please just try his solution.
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.