Hi all,
I currently have web form set up in Confluence which collects information from the end user and creates a Jira issue.
Current code:
url: [confluence-domain]/rest/jira-integration/1.0/issues?applicationId=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
type: 'POST',
dataType: 'JSON',
contentType: "application/json",
data: JSON.stringify(issueData),
Is there a way to use the same API to add comments to / update an existing issue?
Thanks,
Nigel
Hi Nigel
You can certainly add comments and update existing issue with the REST API, check the docs
https://docs.atlassian.com/software/jira/docs/api/REST/8.7.0/#api/2/issue-addComment
https://docs.atlassian.com/software/jira/docs/api/REST/8.7.0/#api/2/issue-editIssue
However, I am unsure what the API you are using (jira-integration/1.0/issues) is... looks like a some kind of custom made wrapper around Jira APIs, no?
Alex
Hi Alex,
Thanks for the information :)
I'm still running into issues using the below code, any thoughts on what the issue might be.
function UpdateIssue() {
AJS.$.ajax({
url: 'https://jiraURL/rest/api/2/issue/ABC-123',
data: '{"update" : {"summary" : [{"set" : "Test"}], ' +
'"comment": [{"add": {"body": "Test Comment"}}]}}',
type: 'PUT',
contentType: 'application/json',
dataType: 'json',
error: function () {
alert('Error');
},
success: function() {
document.location.reload();
}
})
}
Thanks,
Nigel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What does Jira say? What is in the error response the Jira returns you? It will tell you what exactly it dislikes about your JSON
Obviously this, does not help in troubleshooting
error: function () {
alert('Error');
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.