python - Jira API Created New fixVerisons value -
trying use jira api set/add fixversions field i'm running error if fixversions value has not been created. i've tried set , add following error response. note able create new fixversions via ui via api.
{"errormessages":[],"errors":{"fixversions":"version name '1.0.0.1' not valid"}}
here sample python working if fixversion exists.
import requests import json header = {'content-type': 'application/json','charset':'utf-8'} # add works if fixversion exists #payload = {"update":{"fixversions":[{"add":{"name":"1.0.0.0"}}]}} payload = {"update": {"fixversions" : [{"set":[{"name":"1.0.0.1"}]}]}} url = 'https://domain.atlassian.net/rest/api/latest/issue/blah-1111' r = requests.put(url,headers=header,json=payload,auth=('user', 'pass')) print r.status_code print r.reason print r.text
found api adding versions under /rest/api/2/version
import requests import json header = {'content-type': 'application/json','charset':'utf-8'} payload = {"description": "1.0.0.1 version", "name": "1.0.0.1", "archived": false, "released": false, "releasedate": "2016-01-29", "project": "blah", "projectid": 100 } url = 'https://domain.atlassian.net/rest/api/2/version' r = requests.post(url,json=payload,headers=header,auth=('user', 'pass')) print r.status_code print r.reason print r.text
Comments
Post a Comment