# ansible jira comment section

**URL:** <https://forum.ansible.com/t/ansible-jira-comment-section/34436>\
**Category:** Ansible Project\
**Created:** [January 14, 2021, 12:07am UTC](https://forum.ansible.com/t/ansible-jira-comment-section/34436 "2021-01-14T00:07:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramesh\_AR](https://avatars.discourse-cdn.com/v4/letter/r/3e96dc/32.png) [@Ramesh\_AR](https://forum.ansible.com/u/Ramesh_AR)\
**Post date:** [January 14, 2021, 12:07am UTC](https://forum.ansible.com/t/ansible-jira-comment-section/34436/1 "2021-01-14T00:07:50Z")

</div>

Hi,

I have a playbook to retrieve user details and getting the output by using debug module. on same playbook second task to comment the user details in JIRA ticket.

any idea how to redirect the debug output to jira module .

- debug:  
msg: “{{ user | list | to\_yaml }}”

- name: Commenting output to Jira  
hosts: 127.0.0.1  
connection: local  
tasks:

- name: Comment on issue  
jira:  
uri: ‘[https://xxxxx](https://xxxxx)’  
username: ‘xxxx’  
password: ‘xxxx’  
issue: ‘xxxx’  
operation: comment  
comment: “{{ user | list | to\_yaml }}” \>\>\> i tried this way but didn’t work  
delegate\_to: localhost

Thank you,  
Ramesh

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [January 14, 2021, 7:31am UTC](https://forum.ansible.com/t/ansible-jira-comment-section/34436/2 "2021-01-14T07:31:39Z")

</div>

What does that “user” variable look like?  
What does “didn’t work” mean exactly?

---

<div class="post-metadata">

**Author:** ![Akasurde](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/akasurde/32/230_2.png) [@Akasurde](https://forum.ansible.com/u/Akasurde)\
**Post date:** [January 14, 2021, 8:18am UTC](https://forum.ansible.com/t/ansible-jira-comment-section/34436/3 "2021-01-14T08:18:11Z")

</div>

Are you getting error messages? I am able to process the comment

- name: Comment an issue  
community.general.jira:  
uri: ‘{{ jirauri }}’  
username: ‘{{ jira\_username }}’  
password: “{{ lookup(‘file’, ‘/Users/akasurde/.jira\_api\_token’) }}”  
project: scrum-project  
operation: comment  
issue: “SP-1”  
comment: “In Progress”  
register: issue\_comment

- debug:  
msg: “{{ issue\_comment }}”

“meta”: {  
“author”: {  
“accountId”: “557079:f1799ad8-ab63-413a-a052-4e0cb738dfa9”,  
“accountType”: “atlassian”,  
“active”: true,  
“avatarUrls”: {},  
“displayName”: “Aab”,  
“emailAddress”: “[xxx@gmail.com](mailto:xxx@gmail.com)”,  
“self”: “[https://ansi.atlassian.net/rest/api/2/user?accountId=557058%3Af1799ad8-ab63-413a-a052-4e0cb738dfa9](https://ansi.atlassian.net/rest/api/2/user?accountId=557058%3Af1799ad8-ab63-413a-a052-4e0cb738dfa9)”,  
“timeZone”: “Asia/Kolkata”  
},  
“body”: “In Progress”,  
“created”: “2021-01-14T13:44:12.521+0530”,  
“id”: “10000”,  
“jsdPublic”: true,  
“self”: “[https://ansi.atlassian.net/rest/api/2/issue/10000/comment/10000](https://ansi.atlassian.net/rest/api/2/issue/10000/comment/10000)”,  
“updateAuthor”: {  
“accountId”: “557079:f1799ad8-ab63-413a-a052-4e0cb738dfa9”,  
“accountType”: “atlassian”,  
“active”: true,  
“avatarUrls”: {  
},  
“displayName”: “aab”,  
“emailAddress”: “[xxx@gmail.com](mailto:xxx@gmail.com)”,  
“self”: “[https://ansi.atlassian.net/rest/api/2/user?accountId=557058%3Af1799ad8-ab63-413a-a052-4e0cb738dfa9](https://ansi.atlassian.net/rest/api/2/user?accountId=557058%3Af1799ad8-ab63-413a-a052-4e0cb738dfa9)”,  
“timeZone”: “Asia/Kolkata”  
}  
}

---

<div class="post-metadata">

**Author:** ![Ramesh\_AR](https://avatars.discourse-cdn.com/v4/letter/r/3e96dc/32.png) [@Ramesh\_AR](https://forum.ansible.com/u/Ramesh_AR)\
**Post date:** [January 14, 2021, 6:26pm UTC](https://forum.ansible.com/t/ansible-jira-comment-section/34436/4 "2021-01-14T18:26:47Z")

</div>

HI Dick / Abhijeet,

I want to pass the below variable data’s to Jira comment section .

TASK [debug] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [test1] =\> {}

MSG:

- {accountStatus: active, id: ‘1’, name: admin, priv: admin}
- {accountStatus: active, id: ‘2’, name: VE, priv: admin}
- {accountStatus: active, id: ‘3’, name: RIOR, priv: admin}
- {accountStatus: active, id: ‘4’, name: VPIO, priv: admin}
- {accountStatus: active, id: ‘5’, name: vie, priv: admin}
- {accountStatus: active, id: ‘6’, name: p5work, priv: admin}
- {accountStatus: active, id: ‘7’, name: DEU, priv: admin}

---

<div class="post-metadata">

**Author:** ![Ramesh\_AR](https://avatars.discourse-cdn.com/v4/letter/r/3e96dc/32.png) [@Ramesh\_AR](https://forum.ansible.com/u/Ramesh_AR)\
**Post date:** [January 14, 2021, 8:35pm UTC](https://forum.ansible.com/t/ansible-jira-comment-section/34436/5 "2021-01-14T20:35:20Z")

</div>

I’m able to comment the debug output but there’s no host/IP details… is there any way to take and comment as well . ?

**Now** : commenting below format,

{accountStatus: active, id: ‘1’, name: admin, priv: admin}

- {accountStatus: active, id: ‘2’, name: VE, priv: admin}
- {accountStatus: active, id: ‘3’, name: RIOR, priv: admin}
- {accountStatus: active, id: ‘4’, name: VPIO, priv: admin}
- {accountStatus: active, id: ‘5’, name: vie, priv: admin}
- {accountStatus: active, id: ‘6’, name: p5work, priv: admin}
- {accountStatus: active, id: ‘7’, name: DEU, priv: admin}

**expecting comment** : should be with hostname / IP address

ok: [test1] =\> {}

MSG:

- {accountStatus: active, id: ‘1’, name: admin, priv: admin}
- {accountStatus: active, id: ‘2’, name: VE, priv: admin}
- {accountStatus: active, id: ‘3’, name: RIOR, priv: admin}
- {accountStatus: active, id: ‘4’, name: VPIO, priv: admin}
- {accountStatus: active, id: ‘5’, name: vie, priv: admin}
- {accountStatus: active, id: ‘6’, name: p5work, priv: admin}
- {accountStatus: active, id: ‘7’, name: DEU, priv: admin}

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [January 14, 2021, 10:31pm UTC](https://forum.ansible.com/t/ansible-jira-comment-section/34436/6 "2021-01-14T22:31:12Z")

</div>

Correct. You didn’t mention that at all, nor how that data looks like, nor where it comes from.

---

<div class="post-metadata">

**Author:** ![Ramesh\_AR](https://avatars.discourse-cdn.com/v4/letter/r/3e96dc/32.png) [@Ramesh\_AR](https://forum.ansible.com/u/Ramesh_AR)\
**Post date:** [January 14, 2021, 11:05pm UTC](https://forum.ansible.com/t/ansible-jira-comment-section/34436/7 "2021-01-14T23:05:47Z")

</div>

Hi Dick,

Sure, Let me provide complete playbook .
