I created a .yml script for ansible about 2 weeks ago for creating a Jira Ticket. The ticket uses custom fields. Some of the custom fields have drop-down list choices. The script was working before but now it returns HTTP Error 400: Bad Request. I tried removing the custom fields with drop-down list choices and it worked. The syntax I used previously for the drop-down list custom fields was this:
args:
fields:
customfield_XXXXX:
value: '{{foo.stdout}}'
I swear I was able to create tickets weeks ago. Did jira change something or is ther something I'm missing?
My script works now. Apparently, the correct syntax for custom fields is this:
args:
fields:
customfield_XXXXX: {
"self": "http://domain.com:port/rest/api/2/customFieldOption/customfieldid",
"value": "customfieldvalue",
"id": "customfieldid"
}
Anyway, thank you guys for the answers and suggestions.
It looks to me that your json is not valid. At least it must be like this:
args:
fields:
customfield_XXXXX: {
value: '{{foo.stdout}}'}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Any help on this greatly appreciated.
Actually i am new to this, I am writing an yaml file to create JIRA ticket through ansible.
I have the script to connect to JIRA, But i got the error
"Skipping no hosts matched" on execution.
this is the script i have:
also if possible anyone can share me a working sample script to create jira ticket
---
- hosts: "{{host_name}}"
remote_user: "{{run_user}}"
vars_prompt:
- name: user name
prompt: "Enter the username"
private: no
- name: password
prompt: "Enter the password"
tasks:
- name: connecting to jira
uri:
url: https://jira.global.xxxxxx.com
user: '{{user name}}'
password: '{{password}}'
method: GET
return_content: yes
status_code: 200
register: Status
- debug:
var: Status.stdout_lines
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HTTP Error 400: Bad Request means your json is incorrect. You need to check the detailed message in the response to find out what exactly is wrong with your json.
Your json probably contains customfields which are not present on the create screen for the issuetype you want to create.
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.