jira server: what is the query which allows to add user into jira group

Marine Tm
Contributor
August 2, 2021

Hello,

 

how can i use rest api jira server for adding or deletting user to/from jira group ?

 

Thank you

2 answers

1 accepted

0 votes
Answer accepted
Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 2, 2021
Marine Tm
Contributor
August 2, 2021

@Mohamed Benziane  thank you 

 

I have already come across this page but I did not really understand how to write the request

i know that i should use the curl command but nothing else ....

Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 2, 2021

Yes you need to write some code but you can use python, java or wathever programming language you know.

I used to write some API calls with python so i'm not sure i can help you with curl.

In your case start with Postman

To add a user try this API 

https://yourdomaine/rest/api/2/group/user?<groupname where you will add the user>

In the body use somethink like that : { "name": "name of the user" }

In authorization panel use Basic authentification and use your username & password.

Like Marine Tm likes this
Marine Tm
Contributor
August 2, 2021

@Mohamed Benziane  do you know any other request to do it with sql server ?

Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 2, 2021

you want to make change directly in the database ? Do not do that, you can break your Jira, always use the UI or REST API. There is only few scenario where you need to use direct query but there are documented by Atlassian.

Marine Tm
Contributor
August 3, 2021

@Mohamed Benziane  i have a test environment 

Mohamed Benziane
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 3, 2021

I don't know how to do it in SQL, but did you try with rest API ? I think this will be too much work to do it with SQL (you will need to stop jira, take a full backup, run you query, test..)

Sam Huawey
Contributor
July 10, 2024

He asks SQL because UI is not available and REST API as well. I have same issue here.

0 votes
Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 4, 2021

Hi @Marine Tm

I seem to understand you are new to API handling/accessing but there are some good examples that should give a basic idea how to access it in general.

Like Mohamed said I would refrain from a direct database update, however if you do not like the API approach there are Apps from marketplace which abstract the needed call and could serve your need.

For REST API here are the examples:
https://developer.atlassian.com/server/jira/platform/rest-apis/#examples

I think this will get you started - the details can be complicated but I do not think you need them right here, the basics should be doable within no-time, it is quite easy.

At least I can share what team members used in the past when it comes to Apps, however please be noted this App is not free and requires payment:
https://bobswift.atlassian.net/wiki/spaces/JCLI/pages/1061003706/addUserToGroup

Regards,
Daniel

Suggest an answer

Log in or Sign up to answer