# I can't edit jira issue with ansible

**URL:** <https://forum.ansible.com/t/i-cant-edit-jira-issue-with-ansible/30513>\
**Category:** Ansible Project\
**Created:** [June 7, 2019, 10:30am UTC](https://forum.ansible.com/t/i-cant-edit-jira-issue-with-ansible/30513 "2019-06-07T10:30:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rodrigo\_Rapozo](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@Rodrigo\_Rapozo](https://forum.ansible.com/u/Rodrigo_Rapozo)\
**Post date:** [June 7, 2019, 10:30am UTC](https://forum.ansible.com/t/i-cant-edit-jira-issue-with-ansible/30513/1 "2019-06-07T10:30:00Z")

</div>

Hello I’m trying to edit a jira issue but I receive 404 I don’t know why

I think that could be because the field hosts is required, but I don’t have ssh to the server and I put other host just to pass.

Any ideia?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [June 7, 2019, 10:38am UTC](https://forum.ansible.com/t/i-cant-edit-jira-issue-with-ansible/30513/2 "2019-06-07T10:38:03Z")

</div>

do you mean the inventory? just change the group in hosts to localhost. In this case you are not ssh to the jira server but, sending api calls.

---

<div class="post-metadata">

**Author:** ![Rodrigo\_Rapozo](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@Rodrigo\_Rapozo](https://forum.ansible.com/u/Rodrigo_Rapozo)\
**Post date:** [June 7, 2019, 10:57am UTC](https://forum.ansible.com/t/i-cant-edit-jira-issue-with-ansible/30513/3 "2019-06-07T10:57:54Z")

</div>

Thanks a lot for the quickly reply.

So I change in my hosts:

[local]  
localhost

and in my playbook:

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [June 7, 2019, 11:16am UTC](https://forum.ansible.com/t/i-cant-edit-jira-issue-with-ansible/30513/4 "2019-06-07T11:16:06Z")

</div>

probably need connection: local or delagate\_to: localhost in the playbook

---

<div class="post-metadata">

**Author:** ![Martin\_Krizek](https://avatars.discourse-cdn.com/v4/letter/m/d26b3c/32.png) [@Martin\_Krizek](https://forum.ansible.com/u/Martin_Krizek)\
**Post date:** [June 7, 2019, 11:28am UTC](https://forum.ansible.com/t/i-cant-edit-jira-issue-with-ansible/30513/5 "2019-06-07T11:28:05Z")

</div>

Or just use ‘implicit localhost’ - [https://docs.ansible.com/ansible/latest/inventory/implicit\_localhost.html](https://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html).

---

<div class="post-metadata">

**Author:** ![Rodrigo\_Rapozo](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@Rodrigo\_Rapozo](https://forum.ansible.com/u/Rodrigo_Rapozo)\
**Post date:** [June 12, 2019, 9:48am UTC](https://forum.ansible.com/t/i-cant-edit-jira-issue-with-ansible/30513/6 "2019-06-12T09:48:26Z")

</div>

I don’t know why the Jira module it’s not working.

IT’S WORKS!!!

_[root@bd9fb0ef9526 playbooks]# curl -u rodrigo:q0y6S3lwmxlHbMYckmA6AF -X POST -d @data.json -H “Content-Type: application/json” “[https://myjira.atlassian.net/rest/api/3/issue](https://myjira.atlassian.net/rest/api/3/issue)”_  
_{“id”:“425566”,“key”:“VFNCDS-1442”,“self”:“[https://myjira.atlassian.net/rest/api/3/issue/425566](https://myjira.atlassian.net/rest/api/3/issue/425566)”}_

_data.json:_

_{_  
_“fields”: {_  
_“project”:_  
_{_  
_“key”: “VFNCDS”_  
_},_  
_“summary”: “REST EXAMPLE2”,_  
_“issuetype”: {_  
_“name”: “Task”_  
_}_  
_}_

_}_

IT’S **NOT** WORKS!!!

_[root@bd9fb0ef9526 playbooks]# ansible-playbook create\_issue.yml_

_PLAY [clients] \*\*\*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\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_  
_fatal: [172.17.0.4]: FAILED! =\> {“changed”: false, “msg”: "HTTP Error 400: "}_  
_to retry, use: --limit @/etc/ansible/playbooks/create\_issue.retry_

_PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*_  
_172.17.0.4 : ok=1 changed=0 unreachable=0 failed=1_

_create\_issue.yml_

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [June 13, 2019, 7:33am UTC](https://forum.ansible.com/t/i-cant-edit-jira-issue-with-ansible/30513/7 "2019-06-13T07:33:52Z")

</div>

Try running your playbook with -vvvvvv

It’s been a while but I had some trouble with the jira module (and also running via python 2) so in the end I switched to using the ‘uri’ module for some things and running any playbooks that interact with jira using python 3.

I forget the exact issue but I couldn’t establish a connection from a python 2.

If you can’t run all your playbooks with python 3 yet then you can choose to run a playbook using python3 like this:

```auto
ansible-playbook sample-playbook.yml -e 'ansible_python_interpreter=/usr/bin/python3'
 (as described here: https://docs.ansible.com/ansible/latest/reference_appendices/python_3_support.html)

Hope this helps,

Jon

```
