Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ansible code bot recommendations #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion devfile.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
schemaVersion: 2.3.0
metadata:
name: ansible-snow-development
Expand All @@ -11,5 +12,5 @@ components:
cpuLimit: 2000m
env:
- name: VSCODE_DEFAULT_WORKSPACE
value: "/"
value: /
name: ansible
5 changes: 2 additions & 3 deletions roles/servicenow_ritm_retrieve_eda/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

- name: Retrieve RITM details with retries
servicenow.itsm.api_info:
resource: sc_req_item
Expand Down Expand Up @@ -41,15 +40,15 @@
- name: Retrieve variable details in one query
servicenow.itsm.api_info:
resource: sc_item_option
sysparm_query: "sys_idIN{{ variable_mappings.record | map(attribute='sc_item_option.value') | join(',') }}"
sysparm_query: sys_idIN{{ variable_mappings.record | map(attribute='sc_item_option.value') | join(',') }}
columns: [item_option_new, value, sys_id]
register: variable_details
when: variable_mappings.record | length > 0

- name: Retrieve variable names using item_option_new IDs
servicenow.itsm.api_info:
resource: item_option_new
sysparm_query: "sys_idIN{{ variable_details.record | map(attribute='item_option_new.value') | join(',') }}"
sysparm_query: sys_idIN{{ variable_details.record | map(attribute='item_option_new.value') | join(',') }}
columns: [sys_id, name]
register: variable_names
when: variable_details.record | length > 0
Expand All @@ -66,7 +65,7 @@
{{
variable_details.record | map(
'combine', {
'request_item': (variable_mappings.record | selectattr('sc_item_option.value', 'equalto', item.sys_id) | map(attribute='request_item.value') | first)

Check warning on line 68 in roles/servicenow_ritm_retrieve_eda/tasks/main.yml

View workflow job for this annotation

GitHub Actions / build

yaml[line-length]

Line too long (161 > 160 characters)

Check warning on line 68 in roles/servicenow_ritm_retrieve_eda/tasks/main.yml

View workflow job for this annotation

GitHub Actions / build

yaml[line-length]

Line too long (161 > 160 characters)
}
) | list
}}
Expand Down
Loading