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

Add inventory plugin option: return_display_value #317

Open
miyuk opened this issue Mar 14, 2024 · 5 comments
Open

Add inventory plugin option: return_display_value #317

miyuk opened this issue Mar 14, 2024 · 5 comments
Labels

Comments

@miyuk
Copy link

miyuk commented Mar 14, 2024

SUMMARY

When inventory plugin query choice field, it return value as human readable label.
However, label value is not useful for ansible inventory.

I want to add options for select value format.

I already make sure resolve it when snow_query.sysparm_display_value sets to False.

So, I want to add option return_display_value, and add parameter to fetch_records function

However, I coudn't investigate other column fields.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

servicenow.itsm.now

ADDITIONAL INFORMATION

below image is configured in ServiceNow column choice field.
image

If return_display_value is true, return label, else return value.

---
plugin: servicenow.itsm.now
columns:
  - u_environment
return_display_value: true or false # <- add option
# `Procution A` when true
# `prod_a` when false
@mhjacks mhjacks added the needs_research Further research is needed to determine the feasibility and scope of the issue. label Mar 14, 2024
@tupyy
Copy link
Contributor

tupyy commented Mar 14, 2024

hello @miyuk
Is the column Environment custom?

@miyuk
Copy link
Author

miyuk commented Mar 15, 2024

hi, @tuppy
Yes, Environment column is customed one of cmdb_ci_server table

@tupyy
Copy link
Contributor

tupyy commented Mar 15, 2024

Can you give me a hint on how can I create it?

@miyuk
Copy link
Author

miyuk commented Mar 15, 2024

@tupyy

  1. access servicenow developer instance(devxxxx.service-now.com)
  2. access cmdb_ci_server table
  3. click left menu and go to Configure > Form Builder
  4. Add filed at Add a field in the table on left tab
  5. Add filed to table column by drag and drop

@tupyy tupyy added verified and removed needs_research Further research is needed to determine the feasibility and scope of the issue. labels Mar 18, 2024
@tupyy
Copy link
Contributor

tupyy commented Mar 18, 2024

@miyuk I'm ok to add the variable but I'll keep the same name as in SNow: sysparm_display_value.

@mhjacks @Akasurde some context:
Currently, the inventory plugin embeds this variable sysparm_display_value and sets it to true. It can be overwritten with sysparm_query.sysparm_display_value but it feels like a hack.
What I propose is to move it into the plugin variables like sysparm_limit. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants