diff --git a/tests/integration/targets/change_request_task/tasks/main.yml b/tests/integration/targets/change_request_task/tasks/main.yml index 44ce1950..87cf0855 100644 --- a/tests/integration/targets/change_request_task/tasks/main.yml +++ b/tests/integration/targets/change_request_task/tasks/main.yml @@ -24,13 +24,15 @@ - change_request_result.record.risk == "low" - change_request_result.record.impact == "low" + - ansible.builtin.set_fact: + prefix: "{{ lookup('password', '/dev/null chars=ascii_letters,digit length=8') | lower }}" - name: Create test change_request_task - check mode servicenow.itsm.change_request_task: &create-change_request_task change_request_number: "{{ change_request_result.record.number }}" type: planning state: pending - short_description: "Implement collision avoidance" + short_description: "{{ prefix }} Implement collision avoidance" description: "Implement collision avoidance based on the newly installed TOF sensor arrays." other: approval: approved @@ -43,7 +45,7 @@ - result.record.change_request == change_request_result.record.sys_id - result.record.change_task_type == "planning" - result.record.state == "pending" - - result.record.short_description == "Implement collision avoidance" + - prefix in result.record.short_description - result.record.description == "Implement collision avoidance based on the newly installed TOF sensor arrays." - result.record.approval == "approved" @@ -69,7 +71,7 @@ - result.records[0].change_request == change_request_result.record.sys_id - result.records[0].change_task_type == "planning" - result.records[0].state == "pending" - - result.records[0].short_description == "Implement collision avoidance" + - prefix in result.records[0].short_description - result.records[0].description == "Implement collision avoidance based on the newly installed TOF sensor arrays." - result.records[0].approval == "approved" @@ -124,7 +126,7 @@ - ansible.builtin.assert: &update-change_request_task-result that: - result is changed - - result.record.short_description == "Implement collision avoidance" + - prefix in result.record.short_description - result.record.state == "in_progress" - result.record.description == "Something changed" - result.record.change_task_type == "planning" @@ -143,7 +145,7 @@ - ansible.builtin.assert: that: - - result.records[0].short_description == "Implement collision avoidance" + - prefix in result.records[0].short_description - result.records[0].state == "in_progress" - result.records[0].description == "Something changed" - result.records[0].change_task_type == "planning" @@ -332,12 +334,13 @@ - name: Get change_request_task info by sysparm query - short_description servicenow.itsm.change_request_task_info: query: - - short_description: LIKE Implement + - short_description: "LIKE {{ prefix }}" register: result + - ansible.builtin.assert: that: - - "'Implement collision' in result.records[0].short_description" + - prefix in result.records[0].short_description - name: Test bad parameter combinator (number + query) servicenow.itsm.change_request_task_info: @@ -425,13 +428,16 @@ register: change_request_result + - ansible.builtin.set_fact: + prefix: "{{ lookup('password', '/dev/null chars=ascii_letters,digit length=8') | lower }}" + - name: Create test change_request_task servicenow.itsm.change_request_task: change_request_number: "{{ change_request_result.record.number }}" type: planning state: open assignment_group: Network - short_description: "Implement collision avoidance" + short_description: "{{ prefix }} Implement collision avoidance" description: "Implement collision avoidance based on the newly installed TOF sensor arrays." other: approval: approved @@ -440,7 +446,6 @@ - ansible.builtin.debug: var: change_request_task - - name: Make sure change_request_task exists servicenow.itsm.change_request_task_info: number: "{{ change_request_task.record.number }}"