Project

General

Profile

Attachments uploading issue

Added by Alexander Tsimbalistov over 10 years ago

Hi, guys!

We try to use rest api to create an issue and attach some files to it.
The requests consequence is like described here: http://www.redmine.org/projects/redmine/wiki/Rest_api

The problem is that files are uploaded and an issue has been created but there is no link between an issue and attachment files. When files are added manually via web-interface everything is just fine.

Please suggest what can be a cause? Below you can find details about requests.

  1. The first request uploads attachments and gets tokens:
    POST, URL=<srv>/uploads.xml
    Content-Type = application/octet-stream
    X-Redmine-API-Key = <apikey>
    <file stream as body>
  2. The second request posts an issue itself:
    POST, URL=<srv>/issues.xml
    Content-Type = application/octet-stream
    X-Redmine-API-Key = <apikey>
    < ?xml version="1.0"?>
    <issue>
    <project_id>3</project_id>
    <tracker_id>13</tracker_id>
    <status_id>1</status_id>
    <priority_id>3</priority_id>
    <subject>...</subject>
    <description>...</description>
    <custom_fields type="array">
    <custom_field name="custom_field_name" id="29">
    <value>553097</value>
    </custom_field></custom_fields>
    <uploads type="Array">
    <upload><token>130.fc21fc466cdafe18c53d4ad342447f6f</token><filename>filename.txt</filename><description></description><content_type>application/x-unknown-content-type</content_type></upload>
    <upload><token>131.fc21fc466cdafe18c53d4ad342447f6f</token><filename>Original_Message.eml</filename><description></description><content_type>application/x-unknown-content-type</content_type></upload>
    </uploads>
    </issue>