Monday, 26 August 2013

JIRA API attachment names contain the whole paths of the posted files

JIRA API attachment names contain the whole paths of the posted files

I have been working with Jira API and have seen inconsistent results for
my requests over and over again. Sometimes it works and sometimes it
doesn't. Last week I was able to post attachments to issues just fine, but
now an old problem occurred: the names of the attachments contain the
whole path of the posted file, hence the attachments can't be opened. I
use json representation to post files:
$array = array("file"=>"@filename");
json_encode($array);
...
This gets the file posted but the problem is when it's posted the file
names in JIRA are like this:
/var/www/user/text.text
needless to say it can't be opened in JIRA. I had this problem before,
then it suddenly disappeared, now it occurred again. I don't really get
it. By the way I am not using curl for this request even though it might
be recommended in the documentation.
I would appreciate it if you could help me
Best regards, Thao

No comments:

Post a Comment