Forums

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

Assign Epic to new or existing Issue via REST API

Michael Court August 23, 2023

I have been scouring teh interweb looking for answers on how to achieve this in a Team-managed Project. There have been many breadcrumbs but nothing definitive...

 

I am using Power Automate (HTTP action, not the Jira connector) to create a new Epic (all ok), then a new Issue (all ok). What I want to be able to do is assign the Epic to the Issue, but I have had no luck doing so either on Issue creation, or by editing the Issue after creation. Has anyone successfully achieved this, and if so, how exactly?

 

1 answer

1 vote
Dam
Community Champion
August 23, 2023

Hi @Michael Court 

In order to create an issue in Jira Cloud you can use this following Rest API: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-post

You can set the Assignee of the issue on creation as follow: 

"assignee": { "id": "5b109f2e9729b51b54dc274d" }

To set the assignee you need to know the User ID... you cannot set the assignee using a Display Name or email address, only the ID can be used here (for all user custom fields) 

To get the ID of a user, you can use the User API: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-get

And search for a user using the name, or email address for example... 

I hope this helps.
Dam.

Michael Court August 27, 2023

Thanks @Dam. Useful info but I'm trying to assign the Epic, not the user.

Dam
Community Champion
August 27, 2023

@Michael Court aaah... sorry I didn't pay attention properly on your question 😊

did you try to use the "parent" field when you create an issue? You can assign the epic key to an issue in the "parent" field:

"parent": {"key": "PROJ-123"}

I didn't try it, but it should work... 
I hope this help.

Dam.

Michael Court August 28, 2023

Thanks @Dam 

 

I will try your solution shortly.

In the meantime I have found a workaround (as follows):

  • Create Epic (Power Automate HTTP action)
  • Create Story (Power Automate HTTP action)
  • Edit Story to assign Epic (Jira Automation)
Like Dam likes this
Dam
Community Champion
August 29, 2023

ah yes Automation can help in this case 🙂 

Suggest an answer

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

Atlassian Community Events