Forums

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

create issue with attachment visible to Jira Portal with REST API

Nihad Azimli January 18, 2019

I am trying to create new issue using JIRA Portal with REST API with attachment. However, when I try to create issue with following command:

issue_dict = {
'project': {'key': 'TF'},
'summary': 'T***************ı',
'description': '',
'issuetype': {'name': 'O*****a'},
'customfield_10024':[{'name': x }],
'attachment':'C:\\Users\\***************************\\T***********ri.pdf'

 I get following error:

response text = {"errorMessages":[],"errors":{"attachment":"Field does not support update 'attachment'"}}

On the other hand, when I create  without attachment part on dict above, attachment cannot be seen in customer portal but I see in issue screen.

 

Is it possible to add attachment via REST API that is visible in portal?

1 answer

0 votes
Warren
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 Leaders.
January 18, 2019

Hi Nihad

Look at the answer by Jeff Caron in this. It's for C# and works for me.

Essentially you need to create the issue without an attachment, then knowing the issue key, you add an attachment to it.

Hope this helps

Nihad Azimli January 18, 2019

The problem is it cannot be seen in JIRA Portal, whilst, it is in the issue screen

Derek Fields _RightStar_
Community Champion
June 13, 2019

I don't know if you got an answer to this question. The reason it can't be seen on the Portal is that you need to add a comment that includes a link to the attachment. The comment needs to have something like:

See [^<filename>]

Suggest an answer

Log in or Sign up to answer