-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting an "Invalid request payload" error with addNewIssue
and an Atlassian Document Format payload
#361
Comments
I pulled this code down and tinkered with things to find that with I saw that one could customize the function internalRequest(options) {
return new Promise((resolve, reject) => {
_request(options.uri, options, (err, httpResponse) => {
if (err) {
reject(err);
} else {
if (httpResponse.statusCode >= 400) {
reject(httpResponse.body);
}
// for compatibility with request-promise
resolve(httpResponse.body);
}
});
});
} An almost exact copy of the default Because, I have other things to now debug. Unfortunately, when I copy and paste that new working function over into my own code... it doesn't work. But I do see a delightfully new set of console log output that I'm not sure where it came from... so, that at least is something different. |
Hey @adamk72, thank you for the detailed description. If you get it working the way you expect then feel free to open an MR or post the solution here! I wouldn't expect that modifying |
Success! I'm not clear on what I was doing wrong in the past that originally prompted me to make this post, but I suspect it had to do with a combination of the However, in the most recent testing, I noticed that I had not applied Really, it was just a question of sorting through the different error types Atlassian was throwing back my way. 🙄 So it appears all is hunky-dory. |
I know this asking a bit beyond what is expected of an open source project, but since it was a red herring in my search. perhaps you can clear something up for for me. No worries if you can't/don't want to. In any case, Thanks for letting me rubber duck this problem out here! 🐣 So here's the ask:
A console log reveals that as being true: {
auth: {
user: '***',
pass: '***'
},
rejectUnauthorized: true,
method: 'POST',
uri: 'https://***/rest/api/3/issue',
json: true,
followAllRedirects: true,
body: { fields: [Object] }
}
} { options: undefined } Am I reading that right? What am I missing that this works? I'd expect |
Hey, there!
I'm working on syncing GitHub issues over to Jira using GH actions. At a basic level, I have this working just fine; authentication and such aren't the problem.
What I'd like to do is to format the descriptions I'm passing to Jira with bold, headers, etc. Passing raw Markdown syntax doesn't behave as expected (such as
## Title
for a header), so I've been trying to pass in an Atlassian Document Format payload.The error I'm getting is:
My payload looks like this (this is the log result right after the object has been
JSON.stringify()
'd):When I pass that payload to the Postman app (with a
POST
command to '{{jiraUrl}}/rest/api/3/issue/') this works fine. My Jira instance updates with no trouble and with the expected formatting.This is what the client setup looks like:
At first I had the wrong
apiVersion
(using 2 instead of 3) in the code, but I corrected that as well, and am not seeing a way to get deeper into the error (I'm assuming it's from Atlassian, but since I don't see it when using Postman, I can't see what I might be doing wrong). I see that the underlying code is usingpostman-request
so I'd think there isn't a major difference in implementations. Looking for a suggestion to see if there's a way to further debug this, or if you know why this might be happening.Thanks for your time in advance. I'm going to keep trying things to see what arises.
The text was updated successfully, but these errors were encountered: