Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Unable to create subtasks using REST /rest/api/2/issue/bulk call ?

Garry May August 26, 2015

Hi,

I'm wondering if someone can help me with an an issue I'm stuck on adding subtasks to a JIRA via node.js and the REST APIs?

I've created a small node.js webserver which responds to webhooks from our OnDemand/Cloud based JIRA instance and for the most part it works, i.e. I can create sessions and retrieve JIRA info via the /rest/api/2/issue call etc, but, when i attempt to use the /rest/api/2/issue/bulk call I receive the following error;

Unexpected end-of-input: expected close marker for OBJECT (from [Source: org.apache.catalina.connector.CoyoteInputStream@cf2ddc; line: 1, column: 398])\n at [Source: org.apache.catalina.connector.CoyoteInputStream@cf2ddc; line: 1, column: 1161]

This is accompanied by response code 400.

Here is the JSON object

var jsonData = {
		"issueUpdates" : [
			{
				"fields" : {
					"project"   : {"id" : "11800"},
					"parent"    : {"key" : "DP-20"},
					"summary"   : "TEST ONLY Baseline Requirements",
					"issuetype" : {"id" : "5"},
					"assignee"  : {"name" : "IBuhar01"}
				}
			}, 
			{
				"fields" : {
					"project"   : {"id" : "11800"},
					"parent"    : {"key" : "DP-20"},
					"summary"   : "TEST ONLY Create Test Cases",
					"issuetype" : {"id" : "5"},
					"assignee"  : {"name" : "jnicho08"}
				}
			}, 
			{
				"fields" : {
					"project"   : {"id" : "11800"},
					"parent"    : {"key" : "DP-20"},
					"summary"   : "TEST ONLY Test Execution",
					"issuetype" : {"id" : "5"},
					"assignee"  : {"name" : "jnicho08"}
				}
			}
		]
	};

 

I have validated that my JSON payload is correct by using it as file based input for a test-stub that uses CURL to successfully attach/create 3 new subtasks for an existing JIRA record.

I'm assuming this error is caused when the POST is performed and JIRA is attempting to deserialise the data but I'm at a loss!  Has any got any ideas what is causing this, what it even means or how to fix it?

Please note, I am using JIRA OnDemand v7.0.0-OD-02-247 and node v0.10.35

Thanks in advance

Garry

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Garry May August 30, 2015

Ok problem solved - when I created this Question I shortened the Summary fields not knowing that was where the problem was located.

It seems it was the extended dash or M-dash characters that were causing the API to bork...what a pain!

Dashes-issue.png

TAGS
AUG Leaders

Atlassian Community Events