search users using email ID

Nachiket Agashe October 30, 2017

How do I search user based on email id of user ? I tried using search API but that did not return results when I specified email address of user. 

 

also how can I assign issue to a user using email ID (instead of login name ?)

 

thanks in advance !

2 answers

0 votes
G V SHABAREESH January 31, 2019

HI Nachiket Agashe

 

u can try this to assign a issue with the issue key.

 

assign_issue(issuekey,assignee name)

 

In my case:

 

wrapper.py:

def assigning_a_issue(self,data):
    try:
        abc = self.jira.assign_issue(issue_key=data['issue'],assignee=data['assignee'])
        return True
    except Exception as e:
        print e
        return False

 

views.py:

class Assigning_Issue(APIView):

    def post(self, request, *args, **kwargs):

        data = request.data
        var = jirawrapper().assigning_a_issue(data)
        if var:
            return Response({'notification':"Added Successfully"}, status=200)
        else:
            return Response({'notification':"Failed To Add"}, status=400)

 

NOTE: postman post

 

{

    "issue_key"="EX-1",

   "assignee"="shabareesh.gv"

}

EX: shabareesh.gv@ggggg.com is my mail id u have to take only name

u can try this...

it is perfect..

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 31, 2017

It depends on where in jira you are searching for users.  If you are in the User Management section of Jira you can search by email address.   This is also something that could be searched on the REST API endpoint api/2/user-findUsers

However it seems like you are trying to do this in the assignee field.  In that case, Jira should be able to allow you to search for users either with name, username, or email address for this field.  However when dealing with the assignee field we also have to content with the Jira permissions schemes: specifically there is a permission called Assignable User.   If the username/email address you are looking for is not listed as an assignable user, then you won't be able to assign that issue to that user, nor will Jira show any results for an otherwise valid email string there.   You can check the permission scheme in place by walking through the steps in Managing project permissions to better understand where this Assignable User permission is defined.

Suggest an answer

Log in or Sign up to answer