Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How I can ivite users to Jira through the REST API?

Marat Aliev
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 2, 2019

Hello!

I have already discovered for myself the power of JiraPS module for Powershell, great tool for administrating! Now I'm searching for ability to send invite to one or multiple users through API or something else (using Powershell). After some deep googling I came to these commands:

$Body = '{"user"' + ':' + '["user@domain.com"]}'

Invoke-RestMethod -WebSession $session.WebSession -Uri "https://domain.atlassian.net/rest/api/2/project/project_ID/role/role_ID" -ContentType "application/json" -method POST -Body $Body
$Body = '{"emails"' + ':' + '["user@domain.com"]}'

Invoke-RestMethod -WebSession $session.WebSession -Uri "https://domain.atlassian.net/servicedesk/customer/portal/portal_id/pages/customers/project_key/invite" -ContentType "application/json" -method POST -Body $Body

 Unfortunately, none of this are working. Is this really possible or we can do it only manually? Or it is really be useful If I could add user to Jira without invitation link (Note: Jira connected to LDAP through Azure AD), of course using command line.

To full understand what I'm talking about, it's the option in 'Site Administration - Users - Invite Users'. Thanks.

0 answers

Suggest an answer

Log in or Sign up to answer