1 year ago

#351957

test-img

user312307

ansible previous value for Jira creation

I am trying to parse following values to jira but it is not able to get the summary from selectattr. Is there any way that I can parse the value from previous values

- name: Create a Jira:
    uri: '{{ server }}'
    username: '{{ user }}'
    password: '{{ pass }}'
    project: '{{project_name}}'
    operation: create
    description: "{{ SCT | selectattr('Details', 'contains', item )| to_nice_yaml }}"
    summary:  "{{ SCT | selectattr('Details', 'contains', 'SCTASK')}}"
    issuetype: Task
    assignee: Gobi,Aalo
  with_items: "{{code}}"
  register: issue

description's result need to be used in summary field since description results contains sctask record number.

code to get sctask and description

- set_fact:
    SCT: "{{ jsoncontent.json | json_query(query)}}"
  vars:
    query: "result[*].{Details: description,SCTASK: number}"

output


     - Details: |2- "some paragraphs"
 
     SCTASK: SCTASK4417321

at the time of output it shows the summary to null.

          summary: '[]'

> **Json Content**

Request Details:
        Item: Form
        Code: Services
        ACode: OG
        Environment: DEV
        Description: 1. Result is coming as not pass for every application
        2. Event is coming as 0 with the log message mentioned below in the additional description
        Priority: High
        Request and Response (XMLs, JSON): Result is not pass
        {"MessageEvalResult":"NOTFOOUND","Result":"FULL","fraudAlertsEvalResult":"FULL","identity":"FULL","Response":{"Score":500,"Inq":0,"Type":"I","Messages":[{"seqNum":0,"message":"No File (L2)"}],"Alerts":null,"Alerts":null,"Alerts":null,"Alerts":[{"code":"500","description":"No File ","priority":High","Id":null,"value":null,"Type":null,"Name":null}]}}
        Platform: Others
      SCTASK: SCTASK1234567

ansible

jira

snow

0 Answers

Your Answer

Accepted video resources