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} +++++++++++++++++++++++++++++++++++++++++++ - set_fact: user: "{{ result.configResolveClass.children|json_query(my_query) }}" vars: my_query: "[].outConfigs.children[].aaaUser.attributes[].{id: id, name: name, priv: priv, accountStatus: accountStatus}" - debug: msg: "{{ user | rejectattr('accountStatus', 'eq', 'inactive')| list | to_yaml }}" ++++++++++++++++++++++++++++++++++++++++++++ Thanks, Ramesh On Thursday, 14 January 2021 at 03:18:46 UTC-5 Abhijeet Kasurde wrote: > 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": "x...@gmail.com", > "self": " > 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", > "updateAuthor": { > "accountId": "557079:f1799ad8-ab63-413a-a052-4e0cb738dfa9", > "accountType": "atlassian", > "active": true, > "avatarUrls": { > }, > "displayName": "aab", > "emailAddress": "x...@gmail.com", > "self": " > https://ansi.atlassian.net/rest/api/2/user?accountId=557058%3Af1799ad8-ab63-413a-a052-4e0cb738dfa9 > ", > "timeZone": "Asia/Kolkata" > } > } > > > On Thu, Jan 14, 2021 at 1:02 PM Dick Visser <dick....@geant.org> wrote: > >> What does that "user" variable look like? >> What does "didn't work" mean exactly? >> >> >> On Thu, 14 Jan 2021 at 01:07, Ramesh AR <rames...@gmail.com> wrote: >> >>> 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' >>> 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 >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Ansible Project" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to ansible-proje...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/ansible-project/a0c47ffb-7a28-49f7-8000-022199a92b75n%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/ansible-project/a0c47ffb-7a28-49f7-8000-022199a92b75n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> Sent from a mobile device - please excuse the brevity, spelling and >> punctuation. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ansible Project" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to ansible-proje...@googlegroups.com. >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/CAL8fbwMRS2igX_O-%2BbkXqThg6jRa-Y_GcNP78aMtEttQJk_fcQ%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/ansible-project/CAL8fbwMRS2igX_O-%2BbkXqThg6jRa-Y_GcNP78aMtEttQJk_fcQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > Thanks, > Abhijeet Kasurde > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4efc0983-59d5-4bb4-bab0-db0b80cf981fn%40googlegroups.com.