diff --git a/plugins/servicenow-check-license-inventory/.codeblocks/block_1.sh b/plugins/servicenow-check-license-inventory/.codeblocks/block_1.sh deleted file mode 100644 index 373e167e..00000000 --- a/plugins/servicenow-check-license-inventory/.codeblocks/block_1.sh +++ /dev/null @@ -1 +0,0 @@ -curl --location --request GET 'https://your-instance.service-now.com/api/now/table/alm_license' diff --git a/plugins/servicenow-check-license-inventory/.codeblocks/block_2.sh b/plugins/servicenow-check-license-inventory/.codeblocks/block_2.sh deleted file mode 100644 index 422af9c8..00000000 --- a/plugins/servicenow-check-license-inventory/.codeblocks/block_2.sh +++ /dev/null @@ -1,17 +0,0 @@ -steps: - - action: - output_key: get_software_license_details - action_name: get_software_license_inventory_servicenow - progress_updates: - on_complete: ON_COMPLETE_MESSAGE - on_pending: ON_PENDING_MESSAGE - input_args: - software_license_name: data.software_license_name - - return: - output_mapper: - MAP(): - converter: - software_name: item.display_name - total_allocations: item.rights - allocations_available: item.allocations_available - items: data.get_software_license_details.result diff --git a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 1.png b/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 1.png deleted file mode 100644 index 9bd74e9f..00000000 Binary files a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 1.png and /dev/null differ diff --git a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 2.png b/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 2.png deleted file mode 100644 index c2a3ddf2..00000000 Binary files a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 2.png and /dev/null differ diff --git a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 3.png b/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 3.png deleted file mode 100644 index 2fa1235d..00000000 Binary files a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 3.png and /dev/null differ diff --git a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 4.png b/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 4.png deleted file mode 100644 index 1517a40f..00000000 Binary files a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 4.png and /dev/null differ diff --git a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 5.png b/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 5.png deleted file mode 100644 index e37f673b..00000000 Binary files a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 5.png and /dev/null differ diff --git a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 6.png b/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 6.png deleted file mode 100644 index 679df023..00000000 Binary files a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 6.png and /dev/null differ diff --git a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 7.png b/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 7.png deleted file mode 100644 index 61a6a205..00000000 Binary files a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image 7.png and /dev/null differ diff --git a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image.png b/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image.png deleted file mode 100644 index 531daaa0..00000000 Binary files a/plugins/servicenow-check-license-inventory/Check Software License Inventory 103588d8909f81b1bb09fa20f9891c4c/image.png and /dev/null differ diff --git a/plugins/servicenow-check-license-inventory/README.md b/plugins/servicenow-check-license-inventory/README.md index 4a9711d2..b8cf92b3 100644 --- a/plugins/servicenow-check-license-inventory/README.md +++ b/plugins/servicenow-check-license-inventory/README.md @@ -19,37 +19,31 @@ time_in_minutes: 20 # Introduction -Software asset management is crucial for several companies, enabling them to ensure efficiency, reduce costs and plan better. ServiceNow, a robust IT service management (ITSM) platform, provides powerful tools for managing and tracking software assets. +The Check Software License Inventory plugin allows users to look up the available licenses that can be allocated for a particular software through their AI assistant. -Integrating ServiceNow’s asset management capabilities with Moveworks can empower your employees to manage their softwares better, without IT having to step in. - -This guide walks you through to setting up the “Check Software License Inventory” feature on your bot using Creator Studio. This feature can help Copilot’s users to look up available licenses that can be allocated for a particular software. +This guide will help you install this plugin within minutes in Agent Studio. Let’s get started! # Prerequisites -- [Postman](https://www.postman.com/) or an API Testing Tool -- ServiceNow Connector built in Creator Studio (follow the [ServiceNow Connector Guide](https://developer.moveworks.com/creator-studio/resources/connector/?id=servicenow) to create your connector) -- **sam_user (Software Asset Management user)** role. More details [here](https://www.servicenow.com/docs/bundle/vancouver-it-asset-management/page/product/software-asset-management2/reference/r_SAMRoles.html). +- Access to Agent Studio -# **What are we building?** +# What are we building? -## **Conversation Design** +## Agent Design -This [purple chat](https://developer.moveworks.com/creator-studio/developer-tools/purple-chat?conversation=%7B%22startTimestamp%22%3A%2211%3A43%2BAM%22%2C%22messages%22%3A%5B%7B%22parts%22%3A%5B%7B%22richText%22%3A%22How+many+licenses+do+we+have+left+for+HyperCAD%3F%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22richText%22%3A%22Queries+ServiceNow+for+HyperCAD+software+licenses.%22%2C%22status%22%3A%22success%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EChecking+HyperCAD+licenses+in+ServiceNow...%3Cbr%3E%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22assistant%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3EYou+have+%3Cb%3E15%3C%2Fb%3E+remaining+licenses+for+HyperCAD+out+of+%3Cb%3E100%3C%2Fb%3E+total+licenses.%3Cbr%3E%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22citationTitle%22%3A%22HyperCAD+Licenses%22%2C%22connectorName%22%3A%22servicenow%22%7D%5D%7D%5D%2C%22role%22%3A%22assistant%22%7D%5D%7D) shows the experience we are going to build. +This [purple chat](https://developer.moveworks.com/creator-studio/developer-tools/purple-chat?conversation=%7B%22startTimestamp%22%3A%2211%3A43%2BAM%22%2C%22messages%22%3A%5B%7B%22parts%22%3A%5B%7B%22richText%22%3A%22How+many+licenses+do+we+have+left+for+HyperCAD%3F%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22richText%22%3A%22Queries+ServiceNow+for+HyperCAD+software+licenses.%22%2C%22status%22%3A%22success%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EChecking+HyperCAD+licenses+in+ServiceNow...%3Cbr%3E%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22assistant%22%7D%2C%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3EYou+have+%3Cb%3E15%3C%2Fb%3E+remaining+licenses+for+HyperCAD+out+of+%3Cb%3E100%3C%2Fb%3E+total+licenses.%3Cbr%3E%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22citationTitle%22%3A%22HyperCAD+Licenses%22%2C%22connectorName%22%3A%22servicenow%22%7D%5D%7D%5D%2C%22role%22%3A%22assistant%22%7D%5D%7D) shows the experience we are going to build. -# **Creator Studio Components** +# Installation Steps -- **Triggers**: - 1. Natural Language -- **Slots**: - 1. Software name -- **Actions**: - 1. **Retrieve Software License Details**: - - Query the license allocations available for a particular software - 2. Guidelines: - 1. None +We recommend creating the connector for ServiceNow first, prior to installing this plugin. Please follow the [ServiceNow Connector Guide](https://developer.moveworks.com/creator-studio/resources/connector/?id=servicenow) to create the connector. Note that for Check Software License Inventory, you will need to also add the following permissions: + +- **sam_user (Software Asset Management user)** role. More details [here](https://www.servicenow.com/docs/bundle/vancouver-it-asset-management/page/product/software-asset-management2/reference/r_SAMRoles.html). -# **API Research** +After you have configured the connector, please refer to our [plugin installation documentation](https://help.moveworks.com/docs/ai-agent-marketplace) for more information on how to install a plugin. + +# Appendix + +### **API #1: Table API** For building this plugin, we’ll be using ServiceNow’s REST APIs, specifically the [Table API](https://www.servicenow.com/docs/bundle/xanadu-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html), which provides methods for accessing and manipulating records in database tables. @@ -59,142 +53,4 @@ Of the various tables that can be accessed on ServiceNow, for this use case, we curl --request GET \ --url 'https://your-domain.service-now.com/api/now/table/alm_license' --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' -``` - -# Steps - -Let’s now head over to the Creator Studio to make the plugin. - -## **Step 1: Build HTTP Action** - -We first need to define the HTTP Action for fetching all the details of a software license. To do so: - -- In Creator Studio, create a new Action. - - Navigate to `Plugins` section > `Actions` tab - - Click on `CREATE` to define a new action - - ![image.png](Check%20Software%20License%20Inventory%20103588d8909f81b1bb09fa20f9891c4c/image.png) - -- Let’s first take care of the Authorization needed for accessing the API. - -Click on `Use Existing Connector` > select the [**ServiceNow**](https://developer.moveworks.com/creator-studio/resources/connector/?id=servicenow) connector that you just created > Click on `Apply`. - -This will populate the Authorization details needed for the API request to be successful. -- Next, click on the `IMPORT CURL` option and paste the following cURL command: - -```bash -curl --location --request GET 'https://your-instance.service-now.com/api/now/table/alm_license' -``` - -- We will now add relevant filtering query parameters which will help us get the result we want. -- Click on the Params tab. We’ll be adding 2 query parameters. They are as follows: - - Keys: - - sysparm_query - - sysparm_fields - - Values: - - software_model.display_nameLIKE{{software_license_name}} - - display_name, allocations_available, rights - -Adding these parameters helps us filter the response by the software license name given as input and reduce the response body to output only the display name of the software, allocations available and total rights. This is demonstrated in the screenshot below. - -![image.png](Check%20Software%20License%20Inventory%20103588d8909f81b1bb09fa20f9891c4c/image%201.png) - -Notice the {{software_license_name}} value for the sysparm_query parameter. The double curly braces indicate that this value needs to be fetched as an Input Variable. - -- Head over to the Input Variables tab. Here’s what we’ll be adding: - - Name: software_license_name - - Description: software_license_name - - Example Value: Excel - - Data Type: string - -This is shown in the screen shot below. - -![image.png](Check%20Software%20License%20Inventory%20103588d8909f81b1bb09fa20f9891c4c/image%202.png) - -- Click on **Test** to verify if the Connector setup was successful. You should see a successful response, as demonstrated below. The request's response will appear on the left side, and the generated output schema will be displayed on the right. - -If the output schema does not align with the API response or fails to populate automatically, please click the **GENERATE FROM RESPONSE** button to refresh and synchronize the schema with the API response. Click Save. - -![image.png](Check%20Software%20License%20Inventory%20103588d8909f81b1bb09fa20f9891c4c/image%203.png) - -- Add the API Name and API Description as shown below, then click the `Save` button. - -![image.png](Check%20Software%20License%20Inventory%20103588d8909f81b1bb09fa20f9891c4c/image%204.png) - -## **Step 2: Build Compound Action** - -- Head over to the **Compound Actions** tab and click **CREATE** - -![image.png](Check%20Software%20License%20Inventory%20103588d8909f81b1bb09fa20f9891c4c/image%205.png) - -- Give your Compound Action a **Name** and **Description** , then click `Next` Note: Name only letters, numbers, and underscores. We suggest using snake case or camel case formatting (e.g. Workflow_name or workflowName ). Here’s an example: - -![image.png](Check%20Software%20License%20Inventory%20103588d8909f81b1bb09fa20f9891c4c/image%206.png) - -Click Next. - -- Click on the **Script Editor** tab. Here, you can build your compound action using YAML syntax. This syntax allows for defining actions (such as HTTP Requests and APIthon Scripts) and workflow logic (including switch statements, for-each loops, return statements, parallel execution, and try/catch blocks). - -For more details, refer to the [Compound Action Syntax Reference](https://developer.moveworks.com/creator-studio/reference/compound_actions_syntax/). - -```bash -steps: - - action: - output_key: get_software_license_details - action_name: get_software_license_inventory_servicenow - progress_updates: - on_complete: ON_COMPLETE_MESSAGE - on_pending: ON_PENDING_MESSAGE - input_args: - software_license_name: data.software_license_name - - return: - output_mapper: - MAP(): - converter: - software_name: item.display_name - total_allocations: item.rights - allocations_available: item.allocations_available - items: data.get_software_license_details.result -``` - -- Click on the **Input Fields** tab. Here, we will define the required input for our plugin. Here’s what we’ll be adding: - - Name: software_license_name - - Description: Name of the software whose available licenses need to be checked - - Example Value: Excel - - Data Type: string - - Click on Submit - - -## **Step 3: Publish Workflow to Plugin** - -- Navigate to the **Compound Actions** tab and click on the kebab menu (︙). -- Next, select **Publish Workflow to Plugin**. -- Then, verify your **Plugin Name** and **Short Description**. - -![image.png](Check%20Software%20License%20Inventory%20103588d8909f81b1bb09fa20f9891c4c/image%207.png) - -Note: Decide whether to select the **User consent required before execution?** checkbox. Enabling this option prompts users to confirm all slot values before the plugin executes, which is widely considered a best practice. - -- Click **Next** and set up your positive and negative triggering examples. This ensures that the bot activates your plugin in response to relevant utterances. - -Refer to our guide on [**Triggering**](https://developer.moveworks.com/creator-studio/conversation-design/triggers/natural-language-triggers/#how-to-write-good-triggering-examples) for more information. -- Finally, click **Next** and configure the Launch Rules that you want your plugin to adhere to. - -Refer to our guide on [**Launch Rules**](https://developer.moveworks.com/creator-studio/administration/launch-options/) for additional details - -## **Step 4: See it in Action!** - -After clicking the final **Submit** button, your plugin will be published to the bot and will be trigger-able based on your Launch Rules. - -Please wait up to 5 minutes after making changes before testing in your bot. - -If you encounter any issues: - -- Check our [**troubleshooting guides**](https://developer.moveworks.com/creator-studio/troubleshooting/support/) -- Use **Logs** to understand the issue -- Reach out to **Support** - -## Congratulations! - -Copilot’s users should now be able to get the number of licenses available of a particular software through chat. Explore our other guides for more inspiration on what to build next. \ No newline at end of file +``` \ No newline at end of file diff --git a/plugins/servicenow-check-license-renewal-date/.codeblocks/block_1.sh b/plugins/servicenow-check-license-renewal-date/.codeblocks/block_1.sh deleted file mode 100644 index 373e167e..00000000 --- a/plugins/servicenow-check-license-renewal-date/.codeblocks/block_1.sh +++ /dev/null @@ -1 +0,0 @@ -curl --location --request GET 'https://your-instance.service-now.com/api/now/table/alm_license' diff --git a/plugins/servicenow-check-license-renewal-date/.codeblocks/block_2.sh b/plugins/servicenow-check-license-renewal-date/.codeblocks/block_2.sh deleted file mode 100644 index abf4e904..00000000 --- a/plugins/servicenow-check-license-renewal-date/.codeblocks/block_2.sh +++ /dev/null @@ -1,16 +0,0 @@ -steps: - - action: - output_key: get_license_renewal_date_servicenow_result - action_name: get_license_renewal_date_servicenow - progress_updates: - on_complete: ON_COMPLETE_MESSAGE - on_pending: ON_PENDING_MESSAGE - input_args: - software_license_name: data.software_license_name - - return: - output_mapper: - MAP(): - converter: - software_name: item.display_name - end_date: item.end_date - items: data.get_license_renewal_date_servicenow_result.result diff --git a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 1.png b/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 1.png deleted file mode 100644 index 405ac5f3..00000000 Binary files a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 1.png and /dev/null differ diff --git a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 2.png b/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 2.png deleted file mode 100644 index c2a3ddf2..00000000 Binary files a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 2.png and /dev/null differ diff --git a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 3.png b/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 3.png deleted file mode 100644 index fcb1617c..00000000 Binary files a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 3.png and /dev/null differ diff --git a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 4.png b/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 4.png deleted file mode 100644 index 683bd620..00000000 Binary files a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 4.png and /dev/null differ diff --git a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 5.png b/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 5.png deleted file mode 100644 index e37f673b..00000000 Binary files a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 5.png and /dev/null differ diff --git a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 6.png b/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 6.png deleted file mode 100644 index 72df5a91..00000000 Binary files a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 6.png and /dev/null differ diff --git a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 7.png b/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 7.png deleted file mode 100644 index b109dc82..00000000 Binary files a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image 7.png and /dev/null differ diff --git a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image.png b/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image.png deleted file mode 100644 index 531daaa0..00000000 Binary files a/plugins/servicenow-check-license-renewal-date/Look up License Renewal Date 10e588d8909f80f0a14cc553036441c0/image.png and /dev/null differ diff --git a/plugins/servicenow-check-license-renewal-date/README.md b/plugins/servicenow-check-license-renewal-date/README.md index f8eff3d4..7956958e 100644 --- a/plugins/servicenow-check-license-renewal-date/README.md +++ b/plugins/servicenow-check-license-renewal-date/README.md @@ -19,37 +19,31 @@ time_in_minutes: 20 # Introduction -Software asset management is crucial for several companies, enabling them to ensure efficiency, reduce costs and plan better. ServiceNow, a robust IT service management (ITSM) platform, provides powerful tools for managing and tracking software assets. +The Look Up License Renewal Date plugin allows users to look up the renewal date for a particular software through their AI assistant. -Integrating ServiceNow’s asset management capabilities with Moveworks can empower your employees to manage their softwares better, without IT having to step in. - -This guide walks you through to setting up the “Look up License Renewal Date” feature on your bot using Creator Studio. This feature can help Copilot’s users to look up the renewal date for a particular software. +This guide will help you install this plugin within minutes in Agent Studio. Let’s get started! # Prerequisites -- [Postman](https://www.postman.com/) or an API Testing Tool -- ServiceNow Connector built in Creator Studio (follow the [ServiceNow Connector Guide](https://developer.moveworks.com/creator-studio/resources/connector/?id=servicenow) to create your connector) -- **sam_user (Software Asset Management user)** role. More details [here](https://www.servicenow.com/docs/bundle/vancouver-it-asset-management/page/product/software-asset-management2/reference/r_SAMRoles.html). +- Access to Agent Studio -# **What are we building?** +# What are we building? -## **Conversation Design** +## Agent Design -This [purple chat](https://developer.moveworks.com/creator-studio/developer-tools/purple-chat?conversation=%7B%22startTimestamp%22%3A%2211%3A43%2BAM%22%2C%22messages%22%3A%5B%7B%22parts%22%3A%5B%7B%22richText%22%3A%22I+need+to+check+the+renewal+date+for+Microsoft+Office+licenses.%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22richText%22%3A%22Searches+Service+Now+SAM+for+Microsoft+Office+licenses%22%2C%22status%22%3A%22success%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EFound+Microsoft+Office+365+licenses.%3Cbr%3E%3C%2Fp%3E%22%7D%2C%7B%22richText%22%3A%22%3Cb%3E%3Cp%3ELicense+Details%3A%3Cbr%3E%3C%2Fp%3E%3C%2Fb%3E%3Cbr%3E%3Cp%3E%3Cb%3ETotal+Licenses%3A%3C%2Fb%3E+100%3Cbr%3E%3Cb%3EUsed%3A%3C%2Fb%3E+90%3Cbr%3E%3Cb%3ERenewal+Date%3A%3C%2Fb%3E+December+12th%2C+2023%3Cbr%3E%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22citationTitle%22%3A%22Microsoft+Office+365+Licenses%22%2C%22connectorName%22%3A%22servicenow%22%7D%5D%7D%5D%2C%22role%22%3A%22assistant%22%7D%5D%7D) shows the experience we are going to build. +This [purple chat](https://developer.moveworks.com/creator-studio/developer-tools/purple-chat?conversation=%7B%22startTimestamp%22%3A%2211%3A43%2BAM%22%2C%22messages%22%3A%5B%7B%22parts%22%3A%5B%7B%22richText%22%3A%22I+need+to+check+the+renewal+date+for+Microsoft+Office+licenses.%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22richText%22%3A%22Searches+Service+Now+SAM+for+Microsoft+Office+licenses%22%2C%22status%22%3A%22success%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EFound+Microsoft+Office+365+licenses.%3Cbr%3E%3C%2Fp%3E%22%7D%2C%7B%22richText%22%3A%22%3Cb%3E%3Cp%3ELicense+Details%3A%3Cbr%3E%3C%2Fp%3E%3C%2Fb%3E%3Cbr%3E%3Cp%3E%3Cb%3ETotal+Licenses%3A%3C%2Fb%3E+100%3Cbr%3E%3Cb%3EUsed%3A%3C%2Fb%3E+90%3Cbr%3E%3Cb%3ERenewal+Date%3A%3C%2Fb%3E+December+12th%2C+2023%3Cbr%3E%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22citationTitle%22%3A%22Microsoft+Office+365+Licenses%22%2C%22connectorName%22%3A%22servicenow%22%7D%5D%7D%5D%2C%22role%22%3A%22assistant%22%7D%5D%7D) shows the experience we are going to build. -# **Creator Studio Components** +# Installation Steps -- **Triggers**: - 1. Natural Language -- **Slots**: - 1. Software name -- **Actions**: - 1. **Retrieve Software License Renewal Details**: - - Query the license renewal date for a particular software - 2. Guidelines: - 1. None +We recommend creating the connector for ServiceNow first, prior to installing this plugin. Please follow the [ServiceNow Connector Guide](https://developer.moveworks.com/creator-studio/resources/connector/?id=servicenow) to create the connector. Note that for Look Up License Renewal Date, you will need to also add the following permissions: + +- **sam_user (Software Asset Management user)** role. More details [here](https://www.servicenow.com/docs/bundle/vancouver-it-asset-management/page/product/software-asset-management2/reference/r_SAMRoles.html). -# **API Research** +After you have configured the connector, please refer to our [plugin installation documentation](https://help.moveworks.com/docs/ai-agent-marketplace) for more information on how to install a plugin. + +# Appendix + +### **API #1: Table API** For building this plugin, we’ll be using ServiceNow’s REST APIs, specifically the [Table API](https://www.servicenow.com/docs/bundle/xanadu-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html), which provides methods for accessing and manipulating records in database tables. @@ -57,147 +51,10 @@ Of the various tables that can be accessed on ServiceNow, for this use case, we We’ll be making use of the ‘End Date’ Software Entitlement field. More details can be found [here](https://www.servicenow.com/docs/bundle/xanadu-it-asset-management/page/product/software-asset-management2/reference/software-entitlement-fields.html#:~:text=Start%20date%20of%20your%20subscription,specified%20as%20the%20License%20type.). -Please note that the ‘End Date’ field appears only if the License type list is one of Subscription, Perpetual + Maintenance, Maintenance, Perpetual + Software Assurance,Software Assurance, Step-up, or Subscription Step-up. +Please note that the ‘End Date’ field appears only if the License type list is one of Subscription, Perpetual + Maintenance, Maintenance, Perpetual + Software Assurance, Software Assurance, Step-up, or Subscription Step-up. ```bash curl --request GET \ --url 'https://your-domain.service-now.com/api/now/table/alm_license' --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' -``` - -# Steps - -Let’s now head over to the Creator Studio to make the plugin. - -## **Step 1: Build HTTP Action** - -We first need to define the HTTP Action for fetching all the details of a software license. To do so: - -- In Creator Studio, create a new Action. - - Navigate to `Plugins` section > `Actions` tab - - Click on `CREATE` to define a new action - - ![image.png](Look%20up%20License%20Renewal%20Date%2010e588d8909f80f0a14cc553036441c0/image.png) - -- Let’s first take care of the Authorization needed for accessing the API. - -Click on `Use Existing Connector` > select the [**ServiceNow**](https://developer.moveworks.com/creator-studio/resources/connector/?id=servicenow) connector that you just created > Click on `Apply`. - -This will populate the Authorization details needed for the API request to be successful. -- Next, click on the `IMPORT CURL` option and paste the following cURL command: - -```bash -curl --location --request GET 'https://your-instance.service-now.com/api/now/table/alm_license' -``` - -- We will now add relevant filtering query parameters which will help us get the result we want. -- Click on the Params tab. We’ll be adding 2 query parameters. They are as follows: - - Keys: - - sysparm_query - - sysparm_fields - - Values: - - software_model.display_nameLIKE{{software_license_name}} - - display_name, end_date - -Adding these parameters helps us filter the response by the software license name given as input and reduce the response body to output only the display name of the software and the renewal date. This is demonstrated in the screenshot below. - -![image.png](Look%20up%20License%20Renewal%20Date%2010e588d8909f80f0a14cc553036441c0/image%201.png) - -Notice the {{software_license_name}} value for the sysparm_query parameter. The double curly braces indicate that this value needs to be fetched as an Input Variable. - -- Head over to the Input Variables tab. Here’s what we’ll be adding: - - Name: software_license_name - - Description: software_license_name - - Example Value: Excel - - Data Type: string - -This is shown in the screen shot below. - -![image.png](Look%20up%20License%20Renewal%20Date%2010e588d8909f80f0a14cc553036441c0/image%202.png) - -- Click on **Test** to verify if the Connector setup was successful. You should see a successful response, as demonstrated below. The request's response will appear on the left side, and the generated output schema will be displayed on the right. - -If the output schema does not align with the API response or fails to populate automatically, please click the **GENERATE FROM RESPONSE** button to refresh and synchronize the schema with the API response. Click Save. - -![image.png](Look%20up%20License%20Renewal%20Date%2010e588d8909f80f0a14cc553036441c0/image%203.png) - -- Add the API Name and API Description as shown below, then click the `Save` button. - -![image.png](Look%20up%20License%20Renewal%20Date%2010e588d8909f80f0a14cc553036441c0/image%204.png) - -## **Step 2: Build Compound Action** - -- Head over to the **Compound Actions** tab and click **CREATE** - -![image.png](Look%20up%20License%20Renewal%20Date%2010e588d8909f80f0a14cc553036441c0/image%205.png) - -- Give your Compound Action a **Name** and **Description** , then click `Next` Note: Name only letters, numbers, and underscores. We suggest using snake case or camel case formatting (e.g. Workflow_name or workflowName ). Here’s an example: - -![image.png](Look%20up%20License%20Renewal%20Date%2010e588d8909f80f0a14cc553036441c0/image%206.png) - -Click Next. - -- Click on the **Script Editor** tab. Here, you can build your compound action using YAML syntax. This syntax allows for defining actions (such as HTTP Requests and APIthon Scripts) and workflow logic (including switch statements, for-each loops, return statements, parallel execution, and try/catch blocks). - -For more details, refer to the [Compound Action Syntax Reference](https://developer.moveworks.com/creator-studio/reference/compound_actions_syntax/). - -```bash -steps: - - action: - output_key: get_license_renewal_date_servicenow_result - action_name: get_license_renewal_date_servicenow - progress_updates: - on_complete: ON_COMPLETE_MESSAGE - on_pending: ON_PENDING_MESSAGE - input_args: - software_license_name: data.software_license_name - - return: - output_mapper: - MAP(): - converter: - software_name: item.display_name - end_date: item.end_date - items: data.get_license_renewal_date_servicenow_result.result -``` - -- Click on the **Input Fields** tab. Here, we will define the required input for our plugin. Here’s what we’ll be adding: - - Name: software_license_name - - Description: Name of the software whose renewal date need to be checked - - Example Value: Excel - - Data Type: string - - Click on Submit - - -## **Step 3: Publish Workflow to Plugin** - -- Navigate to the **Compound Actions** tab and click on the kebab menu (︙). -- Next, select **Publish Workflow to Plugin**. -- Then, verify your **Plugin Name** and **Short Description**. - -![image.png](Look%20up%20License%20Renewal%20Date%2010e588d8909f80f0a14cc553036441c0/image%207.png) - -Note: Decide whether to select the **User consent required before execution?** checkbox. Enabling this option prompts users to confirm all slot values before the plugin executes, which is widely considered a best practice. - -- Click **Next** and set up your positive and negative triggering examples. This ensures that the bot activates your plugin in response to relevant utterances. - -Refer to our guide on [**Triggering**](https://developer.moveworks.com/creator-studio/conversation-design/triggers/natural-language-triggers/#how-to-write-good-triggering-examples) for more information. -- Finally, click **Next** and configure the Launch Rules that you want your plugin to adhere to. - -Refer to our guide on [**Launch Rules**](https://developer.moveworks.com/creator-studio/administration/launch-options/) for additional details - -## **Step 4: See it in Action!** - -After clicking the final **Submit** button, your plugin will be published to the bot and will be trigger-able based on your Launch Rules. - -Please wait up to 5 minutes after making changes before testing in your bot. - -If you encounter any issues: - -- Check our [**troubleshooting guides**](https://developer.moveworks.com/creator-studio/troubleshooting/support/) -- Use **Logs** to understand the issue -- Reach out to **Support** - -## Congratulations! - -Copilot’s users should now be able to get the license renewal date of a particular software through chat. Explore our other guides for more inspiration on what to build next. \ No newline at end of file +``` \ No newline at end of file diff --git a/plugins/servicenow-lookup-cost-center/.codeblocks/block_1.sh b/plugins/servicenow-lookup-cost-center/.codeblocks/block_1.sh deleted file mode 100644 index 147a2fed..00000000 --- a/plugins/servicenow-lookup-cost-center/.codeblocks/block_1.sh +++ /dev/null @@ -1 +0,0 @@ -curl --location --request GET 'https://your-instance.service-now.com/api/now/table/cmn_cost_center' diff --git a/plugins/servicenow-lookup-cost-center/.codeblocks/block_2.sh b/plugins/servicenow-lookup-cost-center/.codeblocks/block_2.sh deleted file mode 100644 index 987c3de7..00000000 --- a/plugins/servicenow-lookup-cost-center/.codeblocks/block_2.sh +++ /dev/null @@ -1,12 +0,0 @@ -steps: - - action: - output_key: get_cost_center_by_name_result - action_name: get_cost_center_ID_by_name - progress_updates: - on_complete: ON_COMPLETE_MESSAGE - on_pending: ON_PENDING_MESSAGE - input_args: - cost_center_name: data.cost_center - - return: - output_mapper: - cost_center_id: data.get_cost_center_by_name_result diff --git a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 1.png b/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 1.png deleted file mode 100644 index fb4a494d..00000000 Binary files a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 1.png and /dev/null differ diff --git a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 2.png b/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 2.png deleted file mode 100644 index 3c0a2204..00000000 Binary files a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 2.png and /dev/null differ diff --git a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 3.png b/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 3.png deleted file mode 100644 index 4efe5e3b..00000000 Binary files a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 3.png and /dev/null differ diff --git a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 4.png b/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 4.png deleted file mode 100644 index 02628a2c..00000000 Binary files a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 4.png and /dev/null differ diff --git a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 5.png b/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 5.png deleted file mode 100644 index e37f673b..00000000 Binary files a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 5.png and /dev/null differ diff --git a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 6.png b/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 6.png deleted file mode 100644 index 2ea885a7..00000000 Binary files a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 6.png and /dev/null differ diff --git a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 7.png b/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 7.png deleted file mode 100644 index 5fc28127..00000000 Binary files a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image 7.png and /dev/null differ diff --git a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image.png b/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image.png deleted file mode 100644 index 531daaa0..00000000 Binary files a/plugins/servicenow-lookup-cost-center/Look Up a Cost Center ID by its Name 26eea1a938b042dd97a87de0477c7f89/image.png and /dev/null differ diff --git a/plugins/servicenow-lookup-cost-center/README.md b/plugins/servicenow-lookup-cost-center/README.md index 3f1ccf83..c07a9bbe 100644 --- a/plugins/servicenow-lookup-cost-center/README.md +++ b/plugins/servicenow-lookup-cost-center/README.md @@ -19,35 +19,31 @@ video: https://youtu.be/DDmmd2eRphw # Introduction -Retrieving official department information can be a cause of headache for employees of some organizations, forcing them to interact with numerous entities and jumping several hoops for a simple task. +The Look Up a Cost Center ID by its Name plugin allows users to easily find details about cost centers such as their IDs through their AI assistant. -By integrating ServiceNow’s financial management features with Moveworks, your employees can conveniently access and manage crucial financial information without unnecessary hurdles. - -This guide provides a step-by-step process to set up the “Look Up Cost Center ID by its Name” feature on your bot using Creator Studio. With this functionality, Copilot users can easily find key details about cost centers such as their IDs. +This guide will help you install this plugin within minutes in Agent Studio. Let’s get started! # Prerequisites -- [Postman](https://www.postman.com/) or an API Testing Tool -- ServiceNow Connector built in Creator Studio (follow the [ServiceNow Connector Guide](https://developer.moveworks.com/creator-studio/resources/connector/?id=servicenow) to create your connector) -- **What are we building?** +- Access to Agent Studio + +# What are we building? + +## Agent Design + +This [purple chat](https://developer.moveworks.com/creator-studio/developer-tools/purple-chat?conversation=%7B%22startTimestamp%22%3A%2211%3A43+AM%22%2C%22messages%22%3A%5B%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3EWhat+is+the+cost+center+ID+for+Finance%3F%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22richText%22%3A%22%3Cp%3E%E2%9C%85+Working+on+ID%3Cb%3E+of+Finance+Cost+Center%3C%2Fb%3E%3Cbr%3E%E2%8F%B3+Calling+Plugin+%3Cb%3ELookup+Cost+Center%3C%2Fb%3E%3C%2Fp%3E%22%2C%22status%22%3A%22success%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EThe+cost+center+ID+for+%3Cb%3EFinance%3C%2Fb%3E+is+%3Cb%3EACN00003%3C%2Fb%3E.%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22citationTitle%22%3A%22Cost+Center%22%2C%22connectorName%22%3A%22servicenow%22%7D%5D%7D%5D%2C%22role%22%3A%22assistant%22%7D%5D%7D) shows the experience we are going to build. -## **Conversation Design** +# Installation Steps -This [purple chat](https://developer.moveworks.com/creator-studio/developer-tools/purple-chat?conversation=%7B%22startTimestamp%22%3A%2211%3A43+AM%22%2C%22messages%22%3A%5B%7B%22parts%22%3A%5B%7B%22richText%22%3A%22%3Cp%3EWhat+is+the+cost+center+ID+for+Finance%3F%3C%2Fp%3E%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22richText%22%3A%22%3Cp%3E%E2%9C%85+Working+on+ID%3Cb%3E+of+Finance+Cost+Center%3C%2Fb%3E%3Cbr%3E%E2%8F%B3+Calling+Plugin+%3Cb%3ELookup+Cost+Center%3C%2Fb%3E%3C%2Fp%3E%22%2C%22status%22%3A%22success%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EThe+cost+center+ID+for+%3Cb%3EFinance%3C%2Fb%3E+is+%3Cb%3EACN00003%3C%2Fb%3E.%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22citationTitle%22%3A%22Cost+Center%22%2C%22connectorName%22%3A%22servicenow%22%7D%5D%7D%5D%2C%22role%22%3A%22assistant%22%7D%5D%7D) shows the experience we are going to build. +We recommend creating the connector for ServiceNow first, prior to installing this plugin. Please follow the [ServiceNow Connector Guide](https://developer.moveworks.com/creator-studio/resources/connector/?id=servicenow) to create the connector. Note that for Look Up a Cost Center ID by its Name, you will need to also add the following permissions: -# **Creator Studio Components** +- read access to the Cost Center table (cmn_cost_center). -- **Triggers**: - 1. Natural Language -- **Slots**: - 1. Department name -- **Actions**: - 1. **Retrieve Cost Center ID of Department**: - - Query the cost center ID of the department - 2. Guidelines: - 1. None +After you have configured the connector, please refer to our [plugin installation documentation](https://help.moveworks.com/docs/ai-agent-marketplace) for more information on how to install a plugin. -# **API Research** +# Appendix + +### **API #1: Table API** For building this plugin, we’ll be using ServiceNow’s REST APIs, specifically the [Table API](https://www.servicenow.com/docs/bundle/xanadu-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html), which provides methods for accessing and manipulating records in database tables. @@ -57,137 +53,4 @@ Of the various tables that can be accessed on ServiceNow, for this use case, we curl --request GET \ --url 'https://your-domain.service-now.com/api/now/table/cmn_cost_center' --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' -``` - -# Steps - -Let’s now head over to the Creator Studio to make the plugin. - -## **Step 1: Build HTTP Action** - -We first need to define the HTTP Action for fetching all the details of assets with an individual. To do so: - -- In Creator Studio, create a new Action. - - Navigate to `Plugins` section > `Actions` tab - - Click on `CREATE` to define a new action - - ![image.png](Look%20Up%20a%20Cost%20Center%20ID%20by%20its%20Name%2026eea1a938b042dd97a87de0477c7f89/image.png) - -- Let’s first take care of the Authorization needed for accessing the API. - -Click on `Use Existing Connector` > select the [**ServiceNow**](https://developer.moveworks.com/creator-studio/resources/connector/?id=servicenow) connector that you just created > Click on `Apply`. - -This will populate the Authorization details needed for the API request to be successful. -- Next, click on the `IMPORT CURL` option and paste the following cURL command: - -```bash -curl --location --request GET 'https://your-instance.service-now.com/api/now/table/cmn_cost_center' -``` - -- We will now add relevant filtering query parameters which will help us get the result we want. -- Click on the Params tab. We’ll be adding 2 query parameters. They are as follows: - - Keys: - - sysparm_query - - sysparm_fields - - Values: - - name={{cost_center_name}} - - account_number - -Adding these parameters helps us filter the response by an email address and reduce the response body to output only the name of the asset, its display name and its tag. This is demonstrated in the screenshot below. - -![image.png](Look%20Up%20a%20Cost%20Center%20ID%20by%20its%20Name%2026eea1a938b042dd97a87de0477c7f89/image%201.png) - -Notice the {{cost_center_name}} value for the sysparm_query parameter. The double curly braces indicate that this value needs to be fetched as an Input Variable. - -- Head over to the Input Variables tab. Here’s what we’ll be adding: - - Name: cost_center_name - - Description: cost_center_name - - Example Value: Sales - - Data Type: string - -This is shown in the screen shot below. - -![image.png](Look%20Up%20a%20Cost%20Center%20ID%20by%20its%20Name%2026eea1a938b042dd97a87de0477c7f89/image%202.png) - -- Click on **Test** to verify if the Connector setup was successful. You should see a successful response, as demonstrated below. The request's response will appear on the left side, and the generated output schema will be displayed on the right. - -If the output schema does not align with the API response or fails to populate automatically, please click the **GENERATE FROM RESPONSE** button to refresh and synchronize the schema with the API response. Click Save. - -![image.png](Look%20Up%20a%20Cost%20Center%20ID%20by%20its%20Name%2026eea1a938b042dd97a87de0477c7f89/image%203.png) - -- Add the **API Name** and **API Description** as shown below, then click the `Save` button. - -![image.png](Look%20Up%20a%20Cost%20Center%20ID%20by%20its%20Name%2026eea1a938b042dd97a87de0477c7f89/image%204.png) - -## **Step 2: Build Compound Action** - -- Head over to the **Compound Actions** tab and click **CREATE** - -![image.png](Look%20Up%20a%20Cost%20Center%20ID%20by%20its%20Name%2026eea1a938b042dd97a87de0477c7f89/image%205.png) - -- Give your Compound Action a **Name** and **Description** , then click `Next` Note: Name only letters, numbers, and underscores. We suggest using snake case or camel case formatting (e.g. Workflow_name or workflowName ). Here’s an example: - -![image.png](Look%20Up%20a%20Cost%20Center%20ID%20by%20its%20Name%2026eea1a938b042dd97a87de0477c7f89/image%206.png) - -Click Next. - -- Click on the **Script Editor** tab. Here, you can build your compound action using YAML syntax. This syntax allows for defining actions (such as HTTP Requests and APIthon Scripts) and workflow logic (including switch statements, for-each loops, return statements, parallel execution, and try/catch blocks). - -For more details, refer to the [Compound Action Syntax Reference](https://developer.moveworks.com/creator-studio/reference/compound_actions_syntax/). - -```bash -steps: - - action: - output_key: get_cost_center_by_name_result - action_name: get_cost_center_ID_by_name - progress_updates: - on_complete: ON_COMPLETE_MESSAGE - on_pending: ON_PENDING_MESSAGE - input_args: - cost_center_name: data.cost_center - - return: - output_mapper: - cost_center_id: data.get_cost_center_by_name_result -``` - -- Click on the **Input Fields** tab. Here, we will define the required input for our plugin. Here’s what we’ll be adding: - - Name: cost_center_name - - Description: Name of cost center - - Example Value: Sales - - Data Type: string - - Click on Submit - - -## **Step 3: Publish Workflow to Plugin** - -- Navigate to the **Compound Actions** tab and click on the kebab menu (︙). -- Next, select **Publish Workflow to Plugin**. -- First, verify your **Plugin Name** and **Short Description**. - -![image.png](Look%20Up%20a%20Cost%20Center%20ID%20by%20its%20Name%2026eea1a938b042dd97a87de0477c7f89/image%207.png) - -Note: Decide whether to select the **User consent required before execution?** checkbox. Enabling this option prompts users to confirm all slot values before the plugin executes, which is widely considered a best practice. - -- Click **Next** and set up your positive and negative triggering examples. This ensures that the bot activates your plugin in response to relevant utterances. - -Refer to our guide on [**Triggering**](https://developer.moveworks.com/creator-studio/conversation-design/triggers/natural-language-triggers/#how-to-write-good-triggering-examples) for more information. -- Finally, click **Next** and configure the Launch Rules that you want your plugin to adhere to. - -Refer to our guide on [**Launch Rules**](https://developer.moveworks.com/creator-studio/administration/launch-options/) for additional details - -## **Step 4: See it in Action!** - -After clicking the final **Submit** button, your plugin will be published to the bot and will be trigger-able based on your Launch Rules. - -Please wait up to 5 minutes after making changes before testing in your bot. - -If you encounter any issues: - -- Check our [**troubleshooting guides**](https://developer.moveworks.com/creator-studio/troubleshooting/support/) -- Use **Logs** to understand the issue -- Reach out to **Support** - -## Congratulations! - -Copilot’s users should now be able to get the cost center ID of a department by name through chat. Explore our other guides for more inspiration on what to build next. \ No newline at end of file +``` \ No newline at end of file diff --git a/plugins/servicenow-user-assets/.codeblocks/block_0.sh b/plugins/servicenow-user-assets/.codeblocks/block_0.sh index 09ade110..d70df850 100644 --- a/plugins/servicenow-user-assets/.codeblocks/block_0.sh +++ b/plugins/servicenow-user-assets/.codeblocks/block_0.sh @@ -1,3 +1,3 @@ curl --request GET \ ---url 'https://your-domain.service-now.com/api/now/table/alm_asset?sysparm_query=assigned_to.email%3Dexample%40email.com&sysparm_fields=model_category.name%2C%20display_name%2C%20asset_tag\' +--url '[https://your-domain.service-now.com/api/now/table/alm_asset?](https://api/now/table/alm_asset?sysparm_query=assigned_to.email%3Dexample%40email.com&sysparm_fields=model_category.name,display_name,asset_tag)sysparm_query=assigned_to.email%3Dexample%[40email.com](http://40email.com/)&sysparm_fields=model_category.name%2C%20display_name%2C%20asset_tag\' --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' diff --git a/plugins/servicenow-user-assets/.codeblocks/block_1.sh b/plugins/servicenow-user-assets/.codeblocks/block_1.sh deleted file mode 100644 index a6f5c8f2..00000000 --- a/plugins/servicenow-user-assets/.codeblocks/block_1.sh +++ /dev/null @@ -1 +0,0 @@ -curl --location --request GET 'https://your-instance.service-now.com/api/now/table/alm_asset' diff --git a/plugins/servicenow-user-assets/.codeblocks/block_2.sh b/plugins/servicenow-user-assets/.codeblocks/block_2.sh deleted file mode 100644 index a4f8b429..00000000 --- a/plugins/servicenow-user-assets/.codeblocks/block_2.sh +++ /dev/null @@ -1,17 +0,0 @@ -steps: - - action: - output_key: get_my_assets_details_servicenow_result - action_name: get_my_assets_details_servicenow - progress_updates: - on_complete: Completed fetching asset details for user - on_pending: Fetching asset details for user - input_args: - email_addr: meta_info.user.email_addr - - return: - output_mapper: - MAP(): - converter: - display_name: item.display_name - model_category.name: item.model_category.name - asset_tag: item.asset_tag - items: data.get_my_assets_details_servicenow_result.result diff --git a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/Screenshot_2025-01-06_at_11.05.26_AM.png b/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/Screenshot_2025-01-06_at_11.05.26_AM.png deleted file mode 100644 index 71f7af39..00000000 Binary files a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/Screenshot_2025-01-06_at_11.05.26_AM.png and /dev/null differ diff --git a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 1.png b/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 1.png deleted file mode 100644 index f590c9bf..00000000 Binary files a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 1.png and /dev/null differ diff --git a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 2.png b/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 2.png deleted file mode 100644 index dc0ef1c3..00000000 Binary files a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 2.png and /dev/null differ diff --git a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 3.png b/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 3.png deleted file mode 100644 index 84fdb695..00000000 Binary files a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 3.png and /dev/null differ diff --git a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 4.png b/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 4.png deleted file mode 100644 index 765eb2d2..00000000 Binary files a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 4.png and /dev/null differ diff --git a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 5.png b/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 5.png deleted file mode 100644 index e37f673b..00000000 Binary files a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 5.png and /dev/null differ diff --git a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 6.png b/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 6.png deleted file mode 100644 index 20e7d6b5..00000000 Binary files a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image 6.png and /dev/null differ diff --git a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image.png b/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image.png deleted file mode 100644 index 531daaa0..00000000 Binary files a/plugins/servicenow-user-assets/Look Up My Assets ac9d37cc28494071a3f8429c48af2ef5/image.png and /dev/null differ diff --git a/plugins/servicenow-user-assets/README.md b/plugins/servicenow-user-assets/README.md index ae391640..e419684b 100644 --- a/plugins/servicenow-user-assets/README.md +++ b/plugins/servicenow-user-assets/README.md @@ -21,37 +21,31 @@ video: https://www.loom.com/share/ca81f360b91244e6818dc68cb42e2694?sid=d8b54972- # Introduction -Asset management is crucial for several companies, enabling them to ensure efficiency, reduce costs and plan better. ServiceNow, a robust IT service management (ITSM) platform, provides powerful tools for managing and tracking assets. +The Look Up My Assets plugin allows users to look up important asset details, such as its tag and display name through their AI assistant. -Integrating ServiceNow’s asset management capabilities with Moveworks can empower your employees to manage their assets better, without IT having to step in. - -This guide walks you through to setting up the “Look Up My Assets” feature on your bot using Creator Studio. This feature can help Copilot’s users to look up important asset details, such as its tag and display name. +This guide will help you install this plugin within minutes in Agent Studio. Let’s get started! # Prerequisites -- [Postman](https://www.postman.com/) or an API Testing Tool -- ServiceNow Connector built in Creator Studio (follow the [ServiceNow Connector Guide](https://developer.moveworks.com/creator-studio/resources/connector/?id=servicenow) to create your connector) -- **asset (Asset Manager)** role. More details [here](https://www.servicenow.com/docs/bundle/xanadu-it-service-management/page/product/asset-management/reference/r_InstalledWithAssetManagement.html). +- Access to Agent Studio + +# What are we building? -# **What are we building?** +## Agent Design -## **Conversation Design** +This [purple chat](https://developer.moveworks.com/creator-studio/developer-tools/purple-chat?conversation=%7B%22startTimestamp%22%3A%2211%3A43+AM%22%2C%22messages%22%3A%5B%7B%22parts%22%3A%5B%7B%22richText%22%3A%22What+assets+are+currently+registered+under+my+name%3F%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22richText%22%3A%22%3Cp%3E%E2%9C%85+Working+on+%3Cb%3ECheck+My+User+Assets%3C%2Fb%3E%3Cbr%3E%E2%8F%B3+Calling+Plugin+%3Cb%3ELookup+User+Assets%3C%2Fb%3E%3C%2Fp%3E%22%2C%22status%22%3A%22success%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EHere%27s+a+list+of+assets+currently+registered+under+your+name%3A%3Cbr%3E%3Cb%3ELaptop%3A%3C%2Fb%3E+Dell+XPS+15%3Cbr%3E%3Cb%3EMouse%3A%3C%2Fb%3E+Wireless+Mouse+-+Logitech+M720%3Cbr%3E%3Cb%3EKeyboard%3A%3C%2Fb%3E+Mechanical+RGB%3Cbr%3E%3Cb%3EHeadphones%3A%3C%2Fb%3E+Noise+Cancelling+Headphones+-+Bose+QC35%3Cbr%3E%3Cbr%3EIs+there+anything+specific+you+would+like+to+do+with+these+assets+or+any+additional+information+you+require%3F%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22citationTitle%22%3A%22Dell+XPS+15%22%2C%22connectorName%22%3A%22servicenow%22%7D%2C%7B%22citationTitle%22%3A%22Wireless+Mouse+-+Logitech+M720%22%2C%22connectorName%22%3A%22servicenow%22%7D%2C%7B%22citationTitle%22%3A%22Mechanical+RGB%22%2C%22connectorName%22%3A%22servicenow%22%7D%2C%7B%22citationTitle%22%3A%22Noise+Cancelling+Headphones+-+Bose+QC35%22%2C%22connectorName%22%3A%22servicenow%22%7D%5D%7D%5D%2C%22role%22%3A%22assistant%22%7D%5D%7D) shows the experience we are going to build. -This [purple chat](https://developer.moveworks.com/creator-studio/developer-tools/purple-chat?conversation=%7B%22startTimestamp%22%3A%2211%3A43+AM%22%2C%22messages%22%3A%5B%7B%22parts%22%3A%5B%7B%22richText%22%3A%22What+assets+are+currently+registered+under+my+name%3F%22%7D%5D%2C%22role%22%3A%22user%22%7D%2C%7B%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22richText%22%3A%22%3Cp%3E%E2%9C%85+Working+on+%3Cb%3ECheck+My+User+Assets%3C%2Fb%3E%3Cbr%3E%E2%8F%B3+Calling+Plugin+%3Cb%3ELookup+User+Assets%3C%2Fb%3E%3C%2Fp%3E%22%2C%22status%22%3A%22success%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EHere%27s+a+list+of+assets+currently+registered+under+your+name%3A%3Cbr%3E%3Cb%3ELaptop%3A%3C%2Fb%3E+Dell+XPS+15%3Cbr%3E%3Cb%3EMouse%3A%3C%2Fb%3E+Wireless+Mouse+-+Logitech+M720%3Cbr%3E%3Cb%3EKeyboard%3A%3C%2Fb%3E+Mechanical+RGB%3Cbr%3E%3Cb%3EHeadphones%3A%3C%2Fb%3E+Noise+Cancelling+Headphones+-+Bose+QC35%3Cbr%3E%3Cbr%3EIs+there+anything+specific+you+would+like+to+do+with+these+assets+or+any+additional+information+you+require%3F%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22citationTitle%22%3A%22Dell+XPS+15%22%2C%22connectorName%22%3A%22servicenow%22%7D%2C%7B%22citationTitle%22%3A%22Wireless+Mouse+-+Logitech+M720%22%2C%22connectorName%22%3A%22servicenow%22%7D%2C%7B%22citationTitle%22%3A%22Mechanical+RGB%22%2C%22connectorName%22%3A%22servicenow%22%7D%2C%7B%22citationTitle%22%3A%22Noise+Cancelling+Headphones+-+Bose+QC35%22%2C%22connectorName%22%3A%22servicenow%22%7D%5D%7D%5D%2C%22role%22%3A%22assistant%22%7D%5D%7D) shows the experience we are going to build. +# Installation Steps -# **Creator Studio Components** +We recommend creating the connector for ServiceNow first, prior to installing this plugin. Please follow the [ServiceNow Connector Guide](https://developer.moveworks.com/creator-studio/resources/connector/?id=servicenow) to create the connector. Note that for Look Up My Assets, you will need to also add the following permissions: + +- **asset (Asset Manager)** role. More details [here](https://www.servicenow.com/docs/bundle/xanadu-it-service-management/page/product/asset-management/reference/r_InstalledWithAssetManagement.html). -- **Triggers**: - 1. Natural Language -- **Slots**: - 1. None -- **Actions**: - 1. **Retrieve Asset Details of the User**: - - Query the asset details of the user - 2. Guidelines: - 1. None +After you have configured the connector, please refer to our [plugin installation documentation](https://help.moveworks.com/docs/ai-agent-marketplace) for more information on how to install a plugin. -# **API Research** +# Appendix + +### **API #1: Table API** For building this plugin, we’ll be using ServiceNow’s REST APIs, specifically the [Table API](https://www.servicenow.com/docs/bundle/xanadu-api-reference/page/integrate/inbound-rest/concept/c_TableAPI.html), which provides methods for accessing and manipulating records in database tables. @@ -59,137 +53,6 @@ Of the various tables that can be accessed on ServiceNow, for this use case, we ```bash curl --request GET \ ---url 'https://your-domain.service-now.com/api/now/table/alm_asset?sysparm_query=assigned_to.email%3Dexample%40email.com&sysparm_fields=model_category.name%2C%20display_name%2C%20asset_tag\' +--url '[https://your-domain.service-now.com/api/now/table/alm_asset?](https://api/now/table/alm_asset?sysparm_query=assigned_to.email%3Dexample%40email.com&sysparm_fields=model_category.name,display_name,asset_tag)sysparm_query=assigned_to.email%3Dexample%[40email.com](http://40email.com/)&sysparm_fields=model_category.name%2C%20display_name%2C%20asset_tag\' --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' -``` - -# Steps - -Let’s now head over to the Creator Studio to make the plugin. - -## **Step 1: Build HTTP Action** - -We first need to define the HTTP Action for fetching all the details of assets with an individual. To do so: - -- In Creator Studio, create a new Action. - - Navigate to `Plugins` section > `Actions` tab - - Click on `CREATE` to define a new action - - ![image.png](Look%20Up%20My%20Assets%20ac9d37cc28494071a3f8429c48af2ef5/image.png) - -- Let’s first take care of the Authorization needed for accessing the API. - -Click on `Use Existing Connector` > select the [**ServiceNow**](https://developer.moveworks.com/creator-studio/resources/connector/?id=servicenow) connector that you just created > Click on `Apply`. - -This will populate the Authorization details needed for the API request to be successful. -- Next, click on the `IMPORT CURL` option and paste the following cURL command: - - ```bash - curl --location --request GET 'https://your-instance.service-now.com/api/now/table/alm_asset' - ``` - - -- We will now add relevant filtering query parameters which will help us get the result we want. -- Click on the Params tab. We’ll be adding 2 query parameters. They are as follows: - - Keys: - - sysparm_query - - sysparm_fields - - Values: - - assigned_to.email={{email_addr}} - - model_category.name, display_name, asset_tag - -Adding these parameters helps us filter the response by an email address and reduce the response body to output only the name of the asset, its display name and its tag. This is demonstrated in the screenshot below. - -![image.png](Look%20Up%20My%20Assets%20ac9d37cc28494071a3f8429c48af2ef5/image%201.png) - -Notice the {{email_addr}} value for the sysparm_query parameter. The double curly braces indicate that this value needs to be fetched as an Input Variable. - -- Head over to the Input Variables tab. Here’s what we’ll be adding: - - Name: email_addr - - Description: email_addr - - Example Value: example@email.com - - Data Type: string - -This is shown in the screen shot below. - -![image.png](Look%20Up%20My%20Assets%20ac9d37cc28494071a3f8429c48af2ef5/image%202.png) - -- Click on **Test** to verify if the Connector setup was successful. You should see a successful response, as demonstrated below. The request's response will appear on the left side, and the generated output schema will be displayed on the right. - -If the output schema does not align with the API response or fails to populate automatically, please click the **GENERATE FROM RESPONSE** button to refresh and synchronize the schema with the API response. - -![image.png](Look%20Up%20My%20Assets%20ac9d37cc28494071a3f8429c48af2ef5/image%203.png) - -- Add the **API Name** and **API Description** as shown below, then click the `Save` button. - - ![image.png](Look%20Up%20My%20Assets%20ac9d37cc28494071a3f8429c48af2ef5/image%204.png) - - -## **Step 2: Build Compound Action** - -- Head over to the **Compound Actions** tab and click **CREATE** - -![image.png](Look%20Up%20My%20Assets%20ac9d37cc28494071a3f8429c48af2ef5/image%205.png) - -- Give your Compound Action a **Name** and **Description** , then click `Next` Note: Name only letters, numbers, and underscores. We suggest using snake case or camel case formatting (e.g. Workflow_name or workflowName ). Here’s an example: - -![Screenshot 2025-01-06 at 11.05.26 AM.png](Look%20Up%20My%20Assets%20ac9d37cc28494071a3f8429c48af2ef5/Screenshot_2025-01-06_at_11.05.26_AM.png) - -Click Next. - -- Click on the **Script Editor** tab. Here, you can build your compound action using YAML syntax. This syntax allows for defining actions (such as HTTP Requests and APIthon Scripts) and workflow logic (including switch statements, for-each loops, return statements, parallel execution, and try/catch blocks). - -For more details, refer to the [Compound Action Syntax Reference](https://developer.moveworks.com/creator-studio/reference/compound_actions_syntax/). - -```bash -steps: - - action: - output_key: get_my_assets_details_servicenow_result - action_name: get_my_assets_details_servicenow - progress_updates: - on_complete: Completed fetching asset details for user - on_pending: Fetching asset details for user - input_args: - email_addr: meta_info.user.email_addr - - return: - output_mapper: - MAP(): - converter: - display_name: item.display_name - model_category.name: item.model_category.name - asset_tag: item.asset_tag - items: data.get_my_assets_details_servicenow_result.result -``` - -## **Step 3: Publish Workflow to Plugin** - -- Navigate to the **Compound Actions** tab and click on the kebab menu (︙). -- Next, select **Publish Workflow to Plugin**. -- First, verify your **Plugin Name** and **Short Description**. - - ![image.png](Look%20Up%20My%20Assets%20ac9d37cc28494071a3f8429c48af2ef5/image%206.png) - - Note: Decide whether to select the **User consent required before execution?** checkbox. Enabling this option prompts users to confirm all slot values before the plugin executes, which is widely considered a best practice. - -- Click **Next** and set up your positive and negative triggering examples. This ensures that the bot activates your plugin in response to relevant utterances. - -Refer to our guide on [**Triggering**](https://developer.moveworks.com/creator-studio/conversation-design/triggers/natural-language-triggers/#how-to-write-good-triggering-examples) for more information. -- Finally, click **Next** and configure the Launch Rules that you want your plugin to adhere to. - -Refer to our guide on [**Launch Rules**](https://developer.moveworks.com/creator-studio/administration/launch-options/) for additional details - -## **Step 4: See it in Action!** - -After clicking the final **Submit** button, your plugin will be published to the bot and will be trigger-able based on your Launch Rules. - -Please wait up to 5 minutes after making changes before testing in your bot. - -If you encounter any issues: - -- Check our [**troubleshooting guides**](https://developer.moveworks.com/creator-studio/troubleshooting/support/) -- Use **Logs** to understand the issue -- Reach out to **Support** - -## Congratulations! - -Copilot’s users should now be able to get details of their assets through chat. Explore our other guides for more inspiration on what to build next. \ No newline at end of file +``` \ No newline at end of file