Forums

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

How to check user exists in JIRA, create JIRA User and login them into JIRA programmatically

Deleted user
December 18, 2011

I need to know how to use JIRA API to implement:

1. check whether a user exists in JIRA (by email or by username);

2. create JIRA user account;

3. log them into JIRA(record session information).

My jira instance version is 4.4.3

4 answers

0 votes
Mizan
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 Champions.
December 21, 2011

Hi,

I am not sure but for 1. & 2. you can use jelly scripts.

below is a jelly script to reset user password.

<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib"
xmlns:core="jelly:core" xmlns:log="jelly:log" xmlns:util="jelly:util" >
<jira:Login username="admin" password="admin">

  <!-- Grab an instance of UserManager -->
  <core:invokeStatic className="com.opensymphony.user.UserManager" method="getInstance" var="userManager"/>

  <!-- Get the User from UserManager -->

<core:invoke on="${userManager}" method="getUser" var="user">
    <core:arg type="java.lang.String" value="user_name"/>
  </core:invoke>
  <core:invoke on="${user}" method="setPassword">
      <core:arg type="java.lang.String" value="new_password"/>
  </core:invoke>

</jira:Login>
</JiraJelly>

Deleted user
July 3, 2012

Hi Mizan,

Thanks for your information.

I can implement integration with my company SSO.

Regards,

Yaoyu

0 votes
Pascal Collard
December 21, 2011

Wouldn't you have to user JIRA's API for this?

0 votes
Deleted user
December 19, 2011

Hi Seliga,

I want to do these in server side. There is a SSO application in my company, I am researching the JIRA integration with it. I added a front filter on jira to check whether user session exists, if not filter will redirect user to this SSO to login. After user login, the SSO will redirect request back to JIRA with user information. I have a servlet to handle this.

I could get the user information in the servlet, now I want to programmatically to the following things:

1. check whether user exist(by username or by email)

2. create JIRA user account

3. transparently log in users to JIRA

I saw some source code of NTLM and CAS integration with JIRA, but the API they used is obsolete.

Please help tell me how to do these things in server side using 4.4 API or give some advice.

Thanks in advance.

Regards,

Yaoyu

0 votes
Wojciech Seliga
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 Champions.
December 18, 2011

do you want to do it on a server side (as JIRA plugin) or remotely (e.g. from a script)?

WRT 3. What do you mean here? Would you like to fully transparently log in users (to their just created accounts) when they are accessing JIRA from web browser? If yes, then how you know who accesses your JIRA instance first? Do you use some other authentication mechanism (like NTLM), etc.?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events