Hello,
I am programmatically creating issues via the JIRA API. These issues have Definition of Done and Acceptance criteria fields which are checklists.
I add the following to my API calls
"customfield_10306": "Security updates applied", "customfield_10325": "Security updates deployed to production"
and get the following error:
{"issues":[],"errors":[{"status":400,"elementErrors":{"errorMessages":[],"errors":{"customfield_10306":"Not a valid JSON object","customfield_10325":"Not a valid JSON object"}},"failedElementNumber":0}]}
How does one create JIRA tickets via the API that contain items within checklist fields?
Thanks!
Version Numbers:
{ "issueUpdates": [{ "fields": { "project": { "key": "QB" }, "summary": "81.80 | ./old.cs10kcommunity_org", "description": " Drupal 6.34 6.37 SECURITY UPDATE available ", "issuetype": { "name": "Task" }, "customfield_10306": "Security updates applied", "customfield_10325": "Security updates deployed to production", "timetracking": { "originalEstimate": "2h", "remainingEstimate": "2h" } } } ]}
https://jira.domainname.com/rest/api/2/issue/bulk
Community moderators have prevented the ability to post new answers.
@M.Decker,
I spent some time looking into it. I was able to create one item. The thing is that the JSON object needs to be encoded into a string so what worked is this:
"customfield_10306"
: "{\"name\": \
"Security updates applied\"}"
The problem is that it will only allow you to create one item. Checklist does not implement the REST interface required to use a JSON object so JIRA falls back to using a string and does its own thing, never actually calling the Checklist field.
So, in order for this to work properly, Checklist needs to implement the REST interfaces. I will put that in our backlog.
Otherwise, it may be feasible posting form data to the url http://localhost:2990/jira/secure/AjaxIssueAction.jspa?decorator=none. This is how JIRA seems to be doing its inline edit. If you monitor the network action in chrome when saving a Checklist from the inline edit mode, you will have an example of the data that is being sent via the form data. However, not sure that it could work because of the session ID.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, any idea if this issue will be resolved on a short term?
@M.Decker, did you succeed using the AjaxIssueAction? I always receive an jira XSRF Security Token exception. Or did you disabled that?
Using JIRA v7.1.2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@@Jeff Maes: I just managed to update a checklist using the AjaxIssueAction request. As @Whyves suggests, I used Chrome inspector to look at the request being sent along with the cookies. I then fabricated a POST request using python requests and supplied it with these cookies:
atlassian.xsrf.token
JSESSIONID
and the following request payload:
[('issueId', u'10479'),
('atl_token',
'<YOUR XSRF TOKEN HERE>'),
('singleFieldEdit', True),
('customfield_10101',
'{"mandatory": true, "checked": true, "name": "Arf", "rank": 1, "id": -1}'),
('customfield_10101',
'{"mandatory": true, "checked": false, "name": "Foo", "rank": 2, "id": -2}'),
('customfield_10101',
'{"mandatory": true, "checked": true, "name": "Bar", "rank": 3, "id": -3}')]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have actually never tried via the JIRA API but if you want to create items try:
"customfield_10306"
: [{"name":
"Security updates applied"}]
,
"customfield_10325"
: [{"name":
"Security updates deployed to production"}]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the quick feedback.
This is the error I receive using the format above:
{"issues":[],"errors":[{"status":400,"elementErrors":{"errorMessages":[],"errors":{"customfield_10306":"Operation value must be a string"}},"failedElementNumber":0}]}
Submitting an array returns "Operation value must be a string." while submitting a string return "Not a valid JSON object".
We're running JIRA 7.0.10 and Checklist v3.1.1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Whyves do you know when Checklist might get support via the REST API, please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Philip Colmer, I'm starting working on a new version which will support REST endpoints. I hope to release it in a few weeks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Whyves any update on the new version supporting REST endpoints?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Timothy Lusk, I have actually implemented it but I need to work on other features of the add-on before releasing it as I want to make a major release. Hopefully in a few weeks.
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.
Hi Timothy,
Sorry, we had to postpone the new version for a few months. We should go back at it at the end of the summer and release it early fall ... hopefully.
I appologize for any inconvenient
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Yves Riel [Okapya] Not to be a pest, but do you have any updates on this? I saw you released a cloud version this month, did that have the API updates? Do you know when you will release the server version with these changes?
We run JIRA 7.5.1 and Checklist 3.1.13
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Mike Sullivan, you're not being a pest :-) I don't really want to commit to a specific date for the moment. We're working on it but it's not going as fast as I would have hoped for. We were able to implement the REST interface and it seems to work but the new version also has other major refactoring and they're not ready so I cannot release it now ... maybe in next year's first quarter.
I really apologize for the too long delays :-(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Yves Riel [Okapya], wanted to follow up and see if there is any update on this?
Edit: Never mind my question and good news for all:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Stephen Johnson, no problems :-)
The REST API has effectively been implemented in our latest release Checklist v4.0.0.
Yves
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there support for creating Checklists programmatically in Jira Cloud?
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.
@Yves Riel [Okapya] I am trying to update my checklist using REST API and followed the same example as listed in the link(https://okapya.atlassian.net/wiki/spaces/CHKDOC/pages/270172389/Modifying+Checklists+using+a+REST+API).
However, I am getting an error.
"errors": {
"customfield_17600": "Operation value must be a string"
Below is the schema of the custom field :
{ "id": "customfield_17600", "name": "Acceptance Criteria (AC):", "custom": true, "orderable": true, "navigable": true, "searchable": true, "clauseNames": [ "Acceptance Criteria (AC):", "cf[17600]" ], "schema": { "type": "any", "custom": "com.okapya.jira.checklist:checklist", "customId": 17600 }
Any thoughts on what am I doing wrong here ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Which version of Checklist are you using? It needs to be v4 and above.
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.
Sorry no, the REST API was only implemented starting with v4. If you know your way around groovy script, you can do it. This forum has many examples for that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Yves Riel [Okapya] We upgraded to 4.0.2 and I am still facing the same issue. Any idea what could I be doing wrong ?
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.
Hi Cormac,
It's in our backlog but it's not planned for the short term and I cannot give you a date for it.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm having the same issue as @Bhargavi Gorantla
How do you find the the checklist plugin version?
Im using JIRA v7.3.8
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Go to the admin section and select the Manage Add-ons page. You'll find there all the installed add-ons and you should find an entry for Checklist along with it's version number.
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.