Is that possible to add script on octopus variable added action?

Hello,

Considering that many users can add\remove\change Octopus variables - it would be nice to be able to log actions like this to some separate place. I mean to catch action when smth happened to variable and run some script for it or smth like this.
Is that possible?

Thanks in advance,
Elena

Hi Elena,

This info should be available under Configuration > Audit on the Octopus server. If you visit that page you’ll find entries like:

a day ago	 admin	Variables for Storefront were changed (hide details)
{
  "OwnerId": "projects-1",
  "Variables": [
    {
      "Id": "8560cfba-3bd6-48d9-a4bb-6416c125c2b6",
      "Name": "Octopus.Action.Package.CustomInstallationDirectory",
      "Prompt": null,
      "CleartextValue": "X:\\Nothing Here",
      "Scope": {}
    }
  ],
  "ModifiedSinceLastSnapshot": falstrue,
  "LastSnapshotNumber": 1,
  "Version": 01,
  "LastSnapshotId": "variableset-projects-1-snapshot-1",
  "IsFrozen": false,
  "Octopus.Platform.Documents.Model.IDocument.Name": "Variables",
  "ScopeValueDefinitions": null
}

This all comes from the Octopus API, so if you wanted to write a script that watched the /api/events resource you could take further action on it.

Hope this helps,
Nick

Hi Nick,

Thank you for your answer. I got the idea.

Regards,
Elena