[GH-ISSUE #1489] Renaming a community script does not rename the script in Automation Manager > Tasks #932

Open
opened 2026-03-02 02:20:01 +03:00 by kerem · 2 comments
Owner

Originally created by @NiceGuyIT on GitHub (Apr 18, 2023).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1489

Originally assigned to: @silversword411, @sadnub on GitHub.

Server Info (please complete the following information):

  • OS: Ubuntu 20.04.4 LTS
  • Browser: Firefox 111.0.1 (64-bit)
  • RMM Version (as shown in top left of web UI): v0.15.9

Installation Method:

  • Standard
  • Docker

Agent Info (please complete the following information):

  • Agent version (as shown in the 'Summary' tab of the agent from web UI): Agent v2.4.6
  • Agent OS: Windows 11 Pro, 64 bit v21H2 (build 22000.1335)

Describe the bug
This is from feature request #1486. Renaming a community script does not rename the script in Automation Manager > Tasks. See this comment for details.

To Reproduce
Steps to reproduce the behavior:

  1. Create a community script and edit the community_scripts.json to match.
  2. Import the community scripts.
  3. Verify the new script is in the script manager.
  4. Add the new script to an automation policy. This is what most people do with community scripts.
  5. Rename the script name. This is not about the filename.
  6. Import the community scripts.
  7. Wait for the system processes to update the script name in all places; it's not automatic.
  8. Check the names in automation policy. The script check name will be updated but the task name will not.

Expected behavior
The script name in the task is updated to the new name.

Screenshots
See this comment for screenshots.

Additional context
When working on scripts with similar names, it's almost impossible to determine which script is associated with a task. Script checks are renamed and easy to find.

Originally created by @NiceGuyIT on GitHub (Apr 18, 2023). Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/1489 Originally assigned to: @silversword411, @sadnub on GitHub. **Server Info (please complete the following information):** - OS: Ubuntu 20.04.4 LTS - Browser: Firefox 111.0.1 (64-bit) - RMM Version (as shown in top left of web UI): v0.15.9 **Installation Method:** - [x] Standard - [ ] Docker **Agent Info (please complete the following information):** - Agent version (as shown in the 'Summary' tab of the agent from web UI): Agent v2.4.6 - Agent OS: Windows 11 Pro, 64 bit v21H2 (build 22000.1335) **Describe the bug** This is from feature request #1486. Renaming a community script does not rename the script in Automation Manager > Tasks. See [this comment][] for details. **To Reproduce** Steps to reproduce the behavior: 1. Create a community script and edit the `community_scripts.json` to match. 2. Import the community scripts. 3. Verify the new script is in the script manager. 4. Add the new script to an automation policy. This is what most people do with community scripts. 5. Rename the script **name**. This is not about the filename. 6. Import the community scripts. 7. Wait for the system processes to update the script name in all places; it's not automatic. 8. Check the names in automation policy. The script check name will be updated but the task name will not. **Expected behavior** The script name in the task is updated to the new name. **Screenshots** See [this comment][] for screenshots. **Additional context** When working on scripts with similar names, it's almost impossible to determine which script is associated with a task. Script checks are renamed and easy to find. [this comment]: https://github.com/amidaware/tacticalrmm/issues/1486#issuecomment-1513692376
Author
Owner

@silversword411 commented on GitHub (May 4, 2023):

8. The script check name will be updated but the task name will not.

Do you mean the actual name of the task under "Tasks"...isn't that manually set via text, and not pulled from the community script script name (like in "Checks"

<!-- gh-comment-id:1534984738 --> @silversword411 commented on GitHub (May 4, 2023): > 8\. The script check name will be updated but the task name will not. Do you mean the actual name of the task under "Tasks"...isn't that manually set via text, and not pulled from the community script script name (like in "Checks"
Author
Owner

@NiceGuyIT commented on GitHub (Jun 1, 2023):

Screenshot of Script Manager for a script that was imported. Notice the dotted lines around the fields.
image

Here's the corresponding JSON.

  {
    "guid": "3ab68e9f-bd3f-403e-97e9-3293d803fb35",
    "filename": "scripts/test-arg-params-issue-1345.ps1",
    "submittedBy": "https://github.com/NiceGuyIT",
    "name": "Test command line arguments for issue 1345",
    "description": "Test apostrophe in description",
    "syntax": "",
    "args": [
      "-agentDescription1={{agent.description}}",
      "-agentDescription2 {{agent.description}}"
    ],
    "default_timeout": 90,
    "shell": "powershell",
    "supported_platforms": [],
    "category": ""
  }

Add the script to Automation manager as both a check and task. Make sure they are both synced and have run.
image

Note: This is the name the user gives to the task, not the name of the script.
image

Now let's change the script name. Here's the new JSON.

  {
    "guid": "3ab68e9f-bd3f-403e-97e9-3293d803fb35",
    "filename": "scripts/test-arg-params-issue-1345.ps1",
    "submittedBy": "https://github.com/NiceGuyIT",
    "name": "Renamed for issue 1489",
    "description": "Test apostrophe in description",
    "syntax": "",
    "args": [
      "-agentDescription1={{agent.description}}",
      "-agentDescription2 {{agent.description}}"
    ],
    "default_timeout": 90,
    "shell": "powershell",
    "supported_platforms": [],
    "category": ""
  }

New name is showing in Script Manager.
image

New name is showing in the check when viewing the agent.
image

As stated above, this name is provided by the user, not the system.
image

Automation manager shows the new name for the check.
image

Automation manager shows the old name when viewing the script attached to the task. This is the only place the new name is not updated.
image

Do you mean the actual name of the task under "Tasks"...isn't that manually set via text, and not pulled from the community script script name (like in "Checks"

When you attach a script to a task, several properties like the script name, arguments, etc. from the script are attached to the task. I'm under the assumption that if community script was updated, the update would flow down into the scripts attached to tasks. Otherwise you would have no idea what version of the script is attached to a task.

Hope that helps!

<!-- gh-comment-id:1571151359 --> @NiceGuyIT commented on GitHub (Jun 1, 2023): Screenshot of Script Manager for a script that was imported. Notice the dotted lines around the fields. ![image](https://github.com/amidaware/tacticalrmm/assets/7763429/04a6be76-d6e9-4b8d-93df-7f85c2a2c538) Here's the corresponding JSON. ```json { "guid": "3ab68e9f-bd3f-403e-97e9-3293d803fb35", "filename": "scripts/test-arg-params-issue-1345.ps1", "submittedBy": "https://github.com/NiceGuyIT", "name": "Test command line arguments for issue 1345", "description": "Test apostrophe in description", "syntax": "", "args": [ "-agentDescription1={{agent.description}}", "-agentDescription2 {{agent.description}}" ], "default_timeout": 90, "shell": "powershell", "supported_platforms": [], "category": "" } ``` Add the script to Automation manager as both a check and task. Make sure they are both synced and have run. ![image](https://github.com/amidaware/tacticalrmm/assets/7763429/5c7a64e2-2666-4de2-af3e-3e15fdd37d2b) > Note: This is the name the user gives to the task, _not the name of the script_. ![image](https://github.com/amidaware/tacticalrmm/assets/7763429/11b7ab1b-6100-4299-8c05-48d85a216596) Now let's change the script name. Here's the new JSON. ```json { "guid": "3ab68e9f-bd3f-403e-97e9-3293d803fb35", "filename": "scripts/test-arg-params-issue-1345.ps1", "submittedBy": "https://github.com/NiceGuyIT", "name": "Renamed for issue 1489", "description": "Test apostrophe in description", "syntax": "", "args": [ "-agentDescription1={{agent.description}}", "-agentDescription2 {{agent.description}}" ], "default_timeout": 90, "shell": "powershell", "supported_platforms": [], "category": "" } ``` New name is showing in Script Manager. ![image](https://github.com/amidaware/tacticalrmm/assets/7763429/0655e095-1cdf-4fce-afdc-81d257325b7a) New name is showing in the check when viewing the agent. ![image](https://github.com/amidaware/tacticalrmm/assets/7763429/0f301313-f617-418c-a532-290c21a60718) > As stated above, this name is provided by the user, _not the system_. ![image](https://github.com/amidaware/tacticalrmm/assets/7763429/7b7c60f8-5760-440a-908c-5a73cf2bccb4) Automation manager shows the new name for the check. ![image](https://github.com/amidaware/tacticalrmm/assets/7763429/02ad3758-37d0-4120-a56f-3587454150ea) Automation manager shows the old name when viewing the script attached to the task. This is the only place the new name is not updated. ![image](https://github.com/amidaware/tacticalrmm/assets/7763429/7bdd2c08-c5e7-4445-aede-7ad0cd5218f2) > Do you mean the actual name of the task under "Tasks"...isn't that manually set via text, and not pulled from the community script script name (like in "Checks" When you attach a script to a task, several properties like the script name, arguments, etc. from the script are attached to the task. I'm under the assumption that if community script was updated, the update would flow down into the scripts attached to tasks. Otherwise you would have no idea what version of the script is attached to a task. Hope that helps!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tacticalrmm#932
No description provided.