Bulk set issue property work with Postman, but returns only 303 and empty body from app

A PUT to /rest/api/3/issue/properties/{propertyKey} with

{
	"value": { 
		"type": "lozenge",
		"value": { 
			"label": "2019-04-28 ... 2019-05-12",
			"type": "moved" 
			
		}
	},
	"filter": {
		"entityIds": ["28820"]
	}
}

return 200 and a body with task information. But the same call made from an app returns success, 303 and empty body:

        const url = `/rest/api/3/issue/properties/{propertyKey}`;
        httpClient.put({
            url,
            json: {
                value: {
                    type: 'lozenge',
                    value: {
                        type: 'moved',
                        label: lozengeMessage
                    }
                },
                filter: {
                    entityIds: issuesAssignedToUser
                }
            },
            contentType: 'application/json',
            "x-atlassian-force-account-id": true
        }, (err, res, body) => {
            if (err) {
                reject(err);
            } else {
                resolve(body);     // End up here ...
            }
        });

What is the difference?

The actual response of the endpoint is 303 with a redirect, as you can see in your app. It’s just that Postman is automatically following it.

Read more about this here: Asynchronous operations.

Thanks for the link :wink:

I ran into this today, so I’m glad this topic is here. However, I tried to pass “followAllRedirects” as an option to the Atlassian Connect Express client and it didn’t pass through the authentication for the redirected URL so I got the Jira 401 HTML page back instead of the task.

Oddly though, you can pull the redirect location out of the headers, where it’s not a relative url and do the request manually with the client as a follow up.

1 Like