Forums

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

Set Assignee and Reporter When creating EPIC or Story

Vijay Gopu August 7, 2020

Hi,

 

I have the following request, that helps me create an EPIC, but doesn't let me add an assignee or a reporter. Could you please let me know how to address this? I have seen a post adding an assignee using id value but don't you think i will have to do a double hop to get the id and then assign it. instead an email id would be much better? additionally, the reporter field doesn't take an id value either. please let me know how to address this.

 

endPoint/rest/api/2/issue/  

method: POST

Request:

```

{
"fields": {
"project":
{
"key": "AENG"
},
"summary": "[TEST] : REST ye merry gentlemen.",
"description": "[TEST] : Creating of an issue using project keys and issue type names using the REST API",
"issuetype": {
"name": "Epic"
},
"customfield_10008" : "TEST",
"assignee": {
"emailAddress": "abc@abc.com"
},
"reporter": {
"emailAddress" : "abc@abc.com"
}
}
}

```

1 answer

1 vote
Fazila Ashraf
Community Champion
August 9, 2020

@Vijay Gopu  , 

The rest api payload takes 'name' as input for the assignee & reporter. It doesnt accept email address. 

For reporter, can you verify whether the reporter field is in create screen and you have 'modify reporter' permission?

Note: Createmeta end point helps ->  https://developer.atlassian.com/server/jira/platform/jira-rest-api-example-discovering-meta-data-for-creating-issues-6291669/ 

Vijay Gopu August 10, 2020

@Fazila Ashraf Thanks for your response.

Yes both Assignee and Reporter are on the create screen. i have passed name in the request, but that didn't get assigned on the ticket either. 

The first screenshot is to show that reporter is available on the create screen and the second one is to show that assignee is available on the create screen.

The third screenshot is request payload with assignee set to my name, and the final screenshot the assignee was unassigned on the JIRA ticket. The response from the API is 201 created.

If you have a sample payload that sets assignee and reporter, could you please share them with me?

Thank you.

 

assignee.pngreporter.pngrequest.pngticket.png

Fazila Ashraf
Community Champion
August 11, 2020

@Vijay Gopu  , do you login to the jira system using the username 'Vijay Gopu'?

That looks like a display name rather a username. Can you check on that?

For JIRA cloud, don't you login with an email address?

Vijay Gopu August 11, 2020

Thanks @Fazila Ashraf

i understood what you meant, it was a bit confusing with name being username. I tried it using my username (which is my email address) but it didn't work, what worked was passing accountId for both assignee and reporter. 

Didn't work:

name_as_username.png

Although i don't like the double hop (i.e using emailaddress to get accountId and then using it while creating an epic or story), i will probably go that route.

Worked:

worked.png

accountId: is obtained by using the following GET operation.

endPoint: /rest/api/3/user/search?query=abc@abc.com

Finally, my username is always an email address, which you quoted earlier that doesn't work too.

Thank you.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events