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

Search for standard changes within custom template tables #254

Closed

Conversation

OskarMarthinussen
Copy link

SUMMARY

Enable the ability to search for standard changes within custom tables, instead of being limited to finding templates solely in the 'std_change_producer_version' table.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

servicenow.itsm.change_request

ADDITIONAL INFORMATION

In my scenario, the standard change I'm searching for is stored in a custom table, which makes it difficult to locate the corresponding template. To address this, I suggest implementing an optional parameter called 'template_table' in the 'find_standard_change()' function. This parameter would allow users to specify a custom table for searching the standard change. To ensure backward compatibility, the parameter could have a default value of 'std_change_producer_version'.

  - name: Create ServiceNow standard change
    servicenow.itsm.change_request:
      instance:
        host: "{{ servicenow_change_instance }}"
        username: "{{ servicenow_change_username }}"
        password: "{{ servicenow_change_password }}"
      type: standard
      state: new
      other:
        company: "{{ servicenow_change_company }}"
      template: "{{ servicenow_change_template }}"
      template_table: "{{ servicenow_change_template_table }}"      <-- New parameter with standard value
    register: snow_change_request

@@ -352,7 +352,7 @@ def build_payload(module, table_client):

if module.params["template"]:
standard_change_template = table.find_standard_change_template(
table_client, module.params["template"]
table_client, module.params["template"], module.params["template_table"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add documentation and tests for this parameter?

Please create a changelog fragment. See this fragment as an example.

@Akasurde Akasurde added the type/enhancement New feature or request label Feb 17, 2024
@Akasurde Akasurde added this to Pending in review in v2.5.0 via automation Mar 7, 2024
@tupyy tupyy self-assigned this Mar 20, 2024
@tupyy
Copy link
Contributor

tupyy commented Mar 20, 2024

Hi @OskarMarthinussen
I have problems understanding how you create a Change request with a template coming from another table than the default one?
The module calls find_standard_change_template to look for the sys_id of the template but then, when you want to create the chg request, it passes the template sys_id like:

{
  "std_change_producer_version": "template_sys_id"
}

I don't see how this will work because the template is not in the std_change_producer_version table.
Do you have a custom field for the template? Could you give me more details on how do you create a chg request with a template from another table please?
Thanks

@mhjacks
Copy link
Collaborator

mhjacks commented May 16, 2024

Thanks for your interest in the project, but this issue has been idle for a long time, so we're closing it. Feel free to rebase against the current main branch and re-open this PR if you would still like to have this considered for inclusion.

@mhjacks mhjacks closed this May 16, 2024
v2.5.0 automation moved this from Pending in review to Done May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants