Currently unmaintained since I have moved from Microfocus Service Manager to ServiceNow - Sorry guys!
A VSCode extenstion which allows you to create and modify Service Manager ScriptLibraries outside the Service Manager Client.
- Multiple Environments
- Create a new ScriptLibrary from a local file
- Push and Pull for ScriptLibraries
- Compile
- Compare
- Execute/Run Code
Just load the extension via the VSCode Marketplace.
Inside the Service Manager, you have to create a new extaccess record.
Please ensure that the used operator has enough permissions to create/update/compile a ScriptLibrary and that the capability RESTful API is set in the operator.
| Field Name | Value |
|---|---|
| Service Name | ScriptLibrary |
| Name | ScriptLibrary |
| Object Name | ScriptLibrary |
| Allowed Actions | Action Names | Action Type |
|---|---|---|
| add | Create | Create only |
| save | Update | Update only |
| compile | Compile | |
| executelibrary | executelibrary |
It's important to use the action name
executelibrary, otherwise, the Execute Command will not work in Visual Studio Code.
| Field | Caption | Type |
|---|---|---|
| name | Name | |
| package | Package | |
| script | Script |
If you're using different Caption Names, you have to modify also the extension settings. See `fields` inside the example settings.
| Field | Value |
|---|---|
| RESTful enabled | true |
| Resource Collection Name | ScriptLibrary |
| Resource Name | ScriptLibrary |
| Unique Keys | name |
| Resource Collection Action - POST | Create |
| Resource Actions - POST | Update |
| Resource Actions - PUT | Compile |
If you're using a different Resource Collection Name and/or Resource Name, you have to modify also the extension settings. See resourceCollection and resourceName inside the example settings.
To run a ScriptLibrary from your Visual Studio Code, you have to create a new Process.
You have to add a new method/process entry in State ScriptLibrary.view.
- Display Action: executelibrary
- Process Name: ScriptLibrary.execute
- Condition:
true
Create a new Process with the name ScriptLibrary.execute.
In the tab Initial Expressions add the following code and save the record.
$L.void=jscall(1 in $L.file)
This is the same code as in the display option for the execute button.
This extension contributes the following settings:
servicemanager.environments- Object - Defines the available environments
"servicemanager" : {
"environments" : {
"env1": {
"name": "Environment 1",
"url": "http://localhost:13080/SM/9/rest/",
"resourceCollection": "ScriptLibrary",
"resourceName": "ScriptLibrary",
"username": "System.Admin",
"password": "System.Admin",
"path": "/Users/marcusreinhardt/Documents/sm/env1/",
"defaultPackage" : "User",
"fields" : {
"name" : "Name",
"package" : "Package",
"script" : "Script"
}
},
"env2": {
"name": "Environment 2",
"url": "http://localhost:23080/SM/9/rest/",
"resourceCollection": "ScriptLibrary",
"resourceName": "ScriptLibrary",
"username": "System.Admin",
"password": "System.Admin",
"path": "/Users/marcusreinhardt/Documents/sm/env2/",
"defaultPackage": "User",
"fields": {
"name": "Name",
"package": "Package",
"script": "Script"
}
}
}
}
Calling out known issues can help limit users opening duplicate issues against your extension.
- Refactored the Extension
- Enabled Compare functionality
- Enabled Execute functionality
Initial release
Special thanks goes to:
- yim OHG - My old company ❤️ They got me the idea to give VSCode a try and here it is - the SM Extension :)