Goal is to create a form in service desk and user will enter the jira group in which they want to be added, if the group exists then automatically add the user to that group
I don't think you can do that. That would be a possible security issue. Only org/site admins can add users to groups.
I am an site admin, we are looking into automation to reduce our manual efforts
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In that case what I would try is to have a custom field on the form with all the groups and I would let the user choose the group.
And then with Jira automation I would send an http request to add this user to the selected group:
POST /rest/api/3/group/user
Trial and error of the above is mandatory :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you @Alex Koxaras _Relational_ I was able to add users using this approach
But, I am able to add user to only 1 group, the automation fails if user has selected more than 1 group name.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aarthi,
Hope you're doing well!
Can please post all the steps with an example on how you have achieved it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The goal is to automatically add the reporter (the person who raised the issue) to the groups specified in the "Group Addition" field whenever the value of that field is updated.
Here is an example of how you can achieve this using the Automation for Jira app and the Jira REST API:
1. First, you will need to set up a rule to trigger on the "Group Addition" field being updated.
2. First, you will need to add a "Send web request" action to the rule. This action will use the Jira REST API to update the reporter's groups.
3. In the "Send web request" action, you will need to specify the following details:
URL: This should be the URL of your Jira instance, followed by "/rest/api/3/group/user".
e.g HTTP method: POST
Headers:
You will need to include the "Content-Type" header with a value of "application/json" Authentication:
You will need to specify the authentication method that you are using to access the Jira REST API.
This could be basic authentication or OAuth, depending on your setup.
Body: You will need to include a JSON payload in the request body that specifies the groups to which you want to add the reporter.
The payload should look something like this:
{ "accountId": "{{issue.reporter.accountId}}", //reporter's accountId}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Pillai_ Aarthi
Any updates to this ? i cant add the reporter to the group. I am using Jira Data Center/Server. Can you please help me with the parsing,, where should I specify the group name. I tried with the webhook URL but no luck
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm actually in the proces of doing this with the same principle with API's, however one step more difficult: not everyone is allowed to join all the groups.
Therefore I've also set up Assets per group and added who the owners of the group are, so that only they can add/remove people from the group via a validation process.
It's quite an intensive use case, but will save me much time as admin as it will allow the, for example, product owners to let people join their team.
To be able to add different groups, you will have to find a way to substitute te group id in the url to a smart value. However this is difficult, I managed to get it done by using assets and their attributes; to change the groupid to a plain text that is the same as the group id.
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.