Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 21


Panel

Table of Contents
maxLevel2

Disclaimer

Your use of this download is governed by Stonebranch’s Terms of Use, which are available at  Stonebranch Integration Hub - Terms of Use.

Overview

Jobs-as-code is an approach to automating software delivery pipelines in which the job configuration is managed as code. This approach allows developers to manage job configurations just like they manage their application code complete with version control, testing, and continuous integration.

Regardless of whether you create your Universal Automation Center (UAC) job definitions using the drag-and-drop designer or as code in a development environment, the UAC jobs-as-code solution provides guidance and tools to integrate those definitions with a Git repository.

Version Information

...

Template Name

...

Extension Name

...

Version

...

Status

...

Jobs As Code

...

ue-jobs-as-code

...

2.0.0

...

Fixes and new features are introduced. Compatibility starts from UAC/UAG 7.4.0.0 onwards.

Refer to Changelog for version history information.

Note

Version 2.0.0 introduces new features that are compatible only for Universal Controller and Universal Agent of version 7.4 onwards. Therefore version 2.0.0 should not be installed if your Universal Controller & Agent is of version less than 7.4

Customers are encouraged to upgrade their Universal Agents to 7.4 to benefit from features introduced on version 2.0

Software Requirements

...


Panel

Table of Contents
maxLevel2

Disclaimer

Your use of this download is governed by Stonebranch’s Terms of Use, which are available at  Stonebranch Integration Hub - Terms of Use.

Overview

Jobs-as-code is an approach to automating software delivery pipelines in which the job configuration is managed as code. This approach allows developers to manage job configurations just like they manage their application code complete with version control, testing, and continuous integration.

Regardless of whether you create your Universal Automation Center (UAC) job definitions using the drag-and-drop designer or as code in a development environment, the UAC jobs-as-code solution provides guidance and tools to integrate those definitions with a Git repository.

Version Information

Template NameExtension NameExtension Version
Jobs As Codeue-jobs-as-code1.2.1

Refer to ChangeLog for version history information.

Anchor
Software Requirements
Software Requirements

Software Requirements

This integration requires a Universal Agent and a Python runtime to execute the Universal Task.

Area

Description

Python Version

Requires Python version

>=

3.7.

16.

  Tested with the Universal Agent bundled Python distribution (python version 3.7.16

and 3.11.6 .

Universal Agent

)

Python Libraries

  • PyGithub: For exporting and importing UAC Definitions from GitHub

  • ruamel.yaml : The installation of the package is recommended but not mandatory for the "Export to Git Repository" action in YAML format. This package ensures that the exported UAC definitions are well-structured with optimal layout and indentation.

Universal Agent

Both Windows and Linux agents are supported:

  • Universal Agent for Windows x64 Version >= 7.

4
  • 2.0.0

  • Universal Agent for Linux Version >= 7.

4
  • 2.0.0

Universal Controller

Universal Controller Version >= 7.

4

2.0.0

Network and Connectivity

This integration needs outbound HTTPS connectivity with GitLab, GitHub, or Bitbucket Cloud for exporting and importing UAC Definitions in addition to HTTPS outbound connectivity to the Universal Controller for retrieving the UAC Definitions and importing them from Git.

GitLab

Supported editions:

  • GitLab Community Edition (REST API v16.6)

  • GitLab Enterprise Edition (REST API v16.6)

GitHub

Supported plans:

  • GitHub Free (X-GitHub-Api-Version:2022-11-28)

  • GitHub Pro (X-GitHub-Api-Version:2022-11-28)

  • GitHub Team (X-GitHub-Api-Version:2022-11-28)
  • GitHub Enterprise Cloud (X-GitHub-Api-Version:2022-11-28)

Bit Bucket

BitBucket

Support plans:

  • Bit Bucket Cloud

Azure DevOps

Supported plans:

  • Azure DevOps Services (Cloud Version) for Git Repos hosted on Azure DevOps Platform

Key Features

FeatureDescription
List UAC DefinitionsQuery UAC definitions prior to running an actual export to Git, to validate the selection criteria, without any write operations in the target repository. This feature should provide a list of UC 
definitions that can then be exported to a Git repository.
Export to Git RepositoryExport selected UAC Definitions to the selected Git Repository. By using this feature, the UAC user will be able to export the selected UAC Definitions to an external Git repository.
After the export, this repository can be used as a backup or as a basis for developer collaboration on top of a source version control system.
Import from Git RepositoryImport selected UAC Definitions. stored already in Git, back to the selected Universal Controller. This feature provides the opportunity for restoration of the UC server (recovery scenarios)
or for updating UAC Definitions. 
For UC version 7.3, or higher, the import feature can be triggered by using webhooks.

...

Feature Flags

There are cases where some functionalities could become deprecated and new features are introduced in a step-wise approach to inform customers early enough to take the necessary steps given potential future breaking changes. The activation/deactivation of those features is controlled by Feature Flags. Not all features are entering this lifecycle approach, but when this is applicable, related feature flags are documented. The Feature State Transition diagram and related information is presented below:

Image Removed

The following features are subject to this lifecycle approach

...

Feature Description

...

Feature State History

...

Information

...

Disable the default commit message prefix.

...

  • Version 2.0.0: “Default Deactivated”

...

This is a stable feature. To enable the feature set Environment variable UE_FF_DISABLE_DEFAULT_COMMIT_PREFIX=True. Any other value or not setting this environment variable, means that the feature is not activated.


Supported Actions

Action: List UAC Definitions

Query UAC definitions prior to running an actual export to Git, to validate the selection criteria, without any write operations in the target repository. This feature should provide a list of UC 
definitions that can later be exported to a Git repository.

Configuration examples

...

Image Removed

...

Image Removed

...

User Scenario:

Query all UAC Definitions are stored in UAC except Scripts and Custom Days, without a proxy connection.

...

User Scenario:

Query all UAC Definitions that are part of a workflow with the name 'test-workflow', with a proxy connection.

Action Output

...

Output Type

...

Description 

...

Supported Actions

Action: List UAC Definitions

Query UAC definitions prior to running an actual export to Git, to validate the selection criteria, without any write operations in the target repository. This feature should provide a list of UC 
definitions that can later be exported to a Git repository.

Configuration examples


Image Added
Image Added
User Scenario: Query all UAC Definitions are stored in UAC except Scripts and Custom Days, without a proxy connection.User Scenario: Query all UAC Definitions that are part of a workflow with the name 'test-workflow', with a proxy connection.


Action Output


Output Type

Description (Successful Execution)

Example (Successful Execution)

EXTENSION

Standard Universal Extension format

The extension output follows the standard Extension output format, providing:

  • “exit_code“, “status“, “status_description“: General info regarding the task execution.

  • “invocation” >

    • “fields”: The task configuration used for this task execution.

Result fields

  • “result” >

    • “definitions_selected”: The UAC definitions that match the filter provided

    .
  • “result” > “errors”: The list of errors occurred during execution.

Expand
titleSuccessful Execution
Code Block
{
   
	"exit_code": 0,
   
	"status": "SUCCESS",
  
 
 
 
 "status_description": "List UAC Definitions executed successfully.",
   
	"invocation": {
 
	 
 
 
 
 
 
 "extension": "ue-jobs-as-code",
 
 
    
 
 
 
 
 
 "version": "1.2.0",
    
 
 
 
 
 
 
 
 "fields": { ... },
  
 
 
 
 },
   
	"result": {
       
		"definitions_selected": {
           
			"agentcluster": 0,
           
			"bundle": 0,
           
			"businessservice": 0,
           
			"calendar": 1,
           
			"databaseconnection": 0,
           
			"emailconnection": 0,
           
			"peoplesoftconnection": 0,
           
			"sapconnection": 1,
           
			"snmpmanager": 0,
           
			"customday": 0,
           
			"emailtemplate": 0,
           
			"script": 0,
           
			"task": 2,
           
			"trigger": 1,
           
			"variable": 1,
           
			"virtual": 0
       
		}
   
	}
}
Expand



title

Description (Failed Execution)

Example (Failed Execution)

Standard Universal Extension format

The extension output follows the standard Extension output format, providing:

“exit_code“, “status“, “status_description“: Will be set according to the specific error that happened during the execution. A list of possible values is provided in the exit codes table in this document.

  • “invocation”

    • “fields”: The task configuration used for this task execution.

Result fields

  • “result”:

    • “definitions_selected”: The UAC definitions that match the filter provided

    • “errors”: The list of errors occurred during execution.


Code Block
{

  
  "exit_code": 21,
    "status_description": "Some errors where produced during data synchronization process:

Task completed with failure. See Extension Output for more details.",
    "status": "FAILED",
    "invocation": {
        
 
"fields": { ...
        
 
}
 

    },
    "result": {
      
  
"definitions_selected": {},
        "errors": [
          
  "List task failed. Could not find agent with id a379367e65c94b918f46b71b0a69795e."
        ]
    
}
}


STDOUT

All definitions matched the selection criteria, in table format.

Action Output


Output Type

Description

Example

EXTENSION

The extension output follows the standard Extension output format, providing:

    • “exit_code“, “status“, “status_description“: General info regarding the task execution.

    • “invocation” > “fields”: The task configuration used for this task execution.

    • “result”>“definitions_selected”: The UAC definitions that match the filter provided.

    • “result”>“definitions_exported”: The UAC definitions that actually exported to the Git provider.

    • “result”>“errors”: The list of errors occurred during execution.

Expand
titleSTDOUT Example
Code Block
=================  =========  =========================================
Type 
Type
              Subtype    Name
=================  =========  =========================================
Business Services  -
 
          jobs-as-code-win
Tasks 
Tasks
             
Manual 
Manual     jobs-as-code-manual-task-win
=================  =========  =========================================

Action: Export to Git Repository

Export selected UAC Definitions to the selected Git Repository. By using this feature, the UAC user can export the selected UAC Definitions to an external Git repository. After the export, this repository can be used as a backup or as a basis for developer collaboration on top of a source control versioning system.

Configuration examples

...

Image Removed

Image Removed

...

User Scenario:

Export to Gitlab UAC Definitions contained in Bundle with name uc_bundle except for Email and Peoplesoft Connections. The selected definitions will be stored under the "/export folder" under the "export/7.3" branch in .yaml format.

...

User Scenario:

Export to Azure DevOps UAC Definitions. Organization and repository names must be included in the Git Service Provider 
URL.

{    
Expand
titleSuccessful Execution
Code Block
{

    "exit_code": 0,
    "status_description": "SUCCESS: Task executed successfully.",
    "status": "SUCCESS",
    "invocation": {
        "extension": "ue-jobs-as-code",
        "version": "1.2.0",
        "fields": { ... }
    },
    "result": {
        "definitions_selected": {
            "agentcluster": 0,
            "businessservice": 1,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 1,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "definitions_exported": {
            "agentcluster": 0,
            "businessservice": 1,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 1,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "errors": [],
    }
Expand
titleFailed Execution
Code Block



Action: Export to Git Repository

Export selected UAC Definitions to the selected Git Repository. By using this feature, the UAC user can export the selected UAC Definitions to an external Git repository. After the export, this repository can be used as a backup or as a basis for developer collaboration on top of a source control versioning system.

Configuration examples


Image Added

Image Added

User Scenario: Export to Gitlab UAC Definitions contained in Bundle with name uc_bundle except for Email and Peoplesoft Connections. The selected definitions will be stored under the "/export folder" under the "export/7.3" branch in .yaml format.

User Scenario: Export to Azure DevOps UAC Definitions. Organization and repository names must be included in the Git Service Provider 
URL.



Action Output

title

Output Type

Description (Successful Execution)

Example (Successful Execution)

EXTENSION

Standard Universal Extension format

The extension output follows the standard Extension output format, providing:

  • “exit_code“, “status“, “status_description“: General info regarding the task execution.

  • “invocation”

    • “fields”: The task configuration used for this task execution.

Result fields

  • “result”

    • “definitions_selected”: The UAC definitions that match the filter provided.

    • “definitions_exported”: The UAC definitions that actually exported to the Git provider.

    • “errors”: The list of errors occurred during execution.


Code Block
{
    "exit_code": 0,
    "status_description": "SUCCESS: Task executed successfully.",
    "status": "SUCCESS",
    "invocation": {
        "extension": "ue-jobs-as-code",
        "version": "1.2.0",
        "fields": { ... }
    },
    "result": {
        "definitions_selected": {
            "agentcluster": 0,
            "businessservice": 1,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 1,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "definitions_exported": {
            "agentcluster": 0,
            "businessservice": 1,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 1,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "errors": [],
    }



Description (Failed Execution)

Example (Failed Execution)

Standard Universal Extension format

The extension output follows the standard Extension output format, providing:

  • “exit_code“,“status“, “status_description“: Will be set according to the specific error that happened during the execution. A list of possible values is provided in the exit codes table in this document.

  • “invocation”

    • “fields”: The task configuration used for this task execution.

Result fields

  • “result”:

    • “definitions_selected”: The UAC definitions that match the filter provided.

    • “definitions_exported”: The UAC definitions that actually exported to the Git provider.

    • “errors”: The list of errors occurred during execution.


Code Block
{
    "exit_code": 21,
  
 
 
 
 "status": "FAIL",
 
   
 
 "status_description": "Export to Git Repository failed with error(s).",
  
 
 
 
 "invocation": {
  
 
   
 
 
 
 
 
 "extension": "ue-jobs-as-code",
 
     
 
 
 
 
 
 "version": "1.2.0",
    
 
 
 
 
 
 
 
 "fields": { ... }
  
 
 
 
 },
  
 
 
 
 "result": {
 
     
 
 
 
 
 
 "definitions_selected": {
      
 
 
 
 
 
 
 
 
 
 
 
 "agentcluster": 0,
      
 
 
 
 
 
 
 
 
 
 
 
 "bundle": 0,
           
            "businessservice": 0,
      
 
 
 
 
 
 
 
 
 
 
 
 "calendar": 1,
 
 
      
 
 
 
 
 
 
 
 
 
 "databaseconnection": 0,
      
 
 
 
 
 
 
 
 
 
 
 
 "emailconnection": 0,
      
 
 
 
 
 
 
 
 
 
 
 
 "peoplesoftconnection": 0,
           
            "sapconnection": 1,
      
 
 
 
 
 
 
 
 
 
 
 
 "snmpmanager": 0,
           
            "customday": 0,
     
 
  
 
 
 
 
 
 
 
 
 
 "emailtemplate": 0,
           

            "script": 1,
           
            "task": 2,
      
 
 
 
 
 
 
 
 
 
 
 
 "trigger": 1,
 
 
      
 
 
 
 
 
 
 
 
 
 "variable": 1
,            
,
            "virtual": 0
 
     
 
 
 
 
 
 },
 
     
 
 
 
 
 
 "definitions_exported": {
      
 
 
 
 
 
 
 
 
 
 
 
 "agentcluster": 0,
 
 
      
 
 
 
 
 
 
 
 
 
 "bundle": 0,
      
 
 
 
 
 
 
 
 
 
 
 
 "businessservice": 0,
      
 
 
 
 
 
 
 
 
 
 
 
 "calendar": 1,
           
            "databaseconnection": 0,
      
 
 
 
 
 
 
 
 
 
 
 
 "emailconnection": 0,
           
            "peoplesoftconnection"
: 0,            
: 0,
            "sapconnection": 1,
           

            "snmpmanager": 0,
           

            "customday": 0,
           

            "emailtemplate": 0,
      
 
 
 
 
 
 
 
 
 
 
 
 "script": 0,
      
 
 
 
 
 
 
 
 
 
 
 
 "task": 2,
           
            "trigger": 1,
      
 
 
 
 
 
 
 
 
 
 
 
 "variable": 1,
 
 
      
 
 
 
 
 
 
 
 
 
 "virtual": 0
        },        

        },
        errors: [
           

            "Failed to create git object for definition 'TestScript' (Git path: /path/script/TestScript.yml)."
    
 
 
 
 
 
 
 
 ]
  
 
 
 
 }
}


STDOUT

All definitions matched the selection criteria, in table format.

Expand


STDOUT Example
Code Block
=================  =========  =========================================  ===========================================================  ========
Type               Subtype    Name                                       Git Path                                                     Status
=================  =========  =========================================  ===========================================================  ========
Business Services  -          jobs-as-code-win                           Business Services/jobs-as-code-win.yaml                      exported
Tasks              Manual     jobs-as-code-manual-task-win               Tasks/Manual/jobs-as-code-manual-task-win.yaml               exported 
Scripts            Data       TestScript                                 Scripts/Data/TestScript.yaml                                 failed
=================  =========  =========================================  ===========================================================  ========


Action: Import from Git Repository

...

Import UC definitions manually

Image Modified
Image Modified
User ScenarioImport the specified files stored in the corresponding paths of Add, Modify, and Remove Definitions Lists from GitHub to UAC. Files under the Add list will be added to UAC, and files under the Modify list will modify existing definitions. Definitions of their paths under the Remove list will be deleted from UAC.User Scenario: Import from GitHub all the files that are stored under the "export/7.3" branch and modify the existing corresponding UAC Definitions.

Import UC definitions automatically via Webhooks

...

The following image demonstrates the flow of events that occur as soon as a GitLab/GitHub/Bitbucket Webhook is triggered.


...

Image Modified

...

Import from Git Repository using Git Webhooks and Global Universal

...

Events 



Configuration

The following steps are a guide to setting up UAC and the integrated Git provider’s Webhook to automatically trigger Jobs As Code Tasks.

  1. Create a new Global Event Template that shall receive the Git provider’s Webhook payload. Set option "Unmapped Attributes Policy" to "Include Attributes".

  2. Create a Universal Monitor and link it with the Global Event Template created in Step 1.

  3. Create a Universal Monitor Trigger assigning to it

    1. the Universal Monitor created in Step 2

    2. a Jobs as Code Task that should be triggered when a new Git Webhook is invoked. The integration task should be configured to utilize the event’s webhook payload (see sections sections Parse GitLab/GitHub Webhook Payload, Parse Bit Bucket and Azure DevOps Webhook Payload), stored in UAC built-in variable ${ops_trigger_<universal_monitor_name>_payload}.

  4. Set up a repository Webhook in the integrated GitLab/GitHub/BitBucket platform and select the "Push" trigger option. Link the Webhook to the Universal Controller Event created in Step 1 as follows:

    1. If the controller URL is https://somehost.yourdomain.com/uc/, the Webhook’s target URL should be https://<uc_user>:<us_password>@somehost.yourdomain.com/uc/resources/universalevent/push/<name of the event>.
      A Webhook can also be configured with a secret token for enhanced security. More information about this feature can be found for GitHub and GitLab providers.11.

...

The best practice suggested to filter out those cyclic imports is to ignore the imports initiated by UAC by configuring a dedicated git user for the “Export” related tasks. The triggered workflow can start with a task that evaluates ${ops_trigger_<universal_monitor_name>_payload} to check if the request is initiated by the UAC git User. If yes, the request can be ignored. If no, the “Import from Git Repository” task can be executed.

The following image demonstrates the example above

Image Modified

...

Filter out webhooks that were triggered from the "Export to git Repository" Action.

Parse GitLab/GitHub Webhook Payload
Anchor
gitlab_github_webhook
gitlab_github_webhook

Image Modified

Image Modified

Parse UAC variable holding the webhook payload, using UAC built-in JSON Path function:

${_varJsonPath('ops_trigger_<universal_monitor_task_name>_payload','$.commits[*].added[*]','',',')}

Import from GitLab/GitHub via Webhook



Note
  1. Task variables can also be used with the normal Controller syntax, for instance: ${added_definitions} . However, it is strongly suggested to use the custom [var: <variable name>], in order to avoid reaching size limits due to variable resolution on the fly.
  2. In this scenario, any input in the Webhook Payload field will be ignored.

Parse Bit Bucket and Azure DevOps Webhook Payload
Anchor
bitbucket_webhook
bitbucket

...

Image Removed

...

_webhook

Image Added

Import from Bitbucket via Webhook



Note

In this scenario, any input in Add/Modify/Remove UC Definition List fields will be ignored.

...

Action Output

Successful Execution

Output Type

Description (Successful Execution)

Example (Successful Execution)

EXTENSION

Standard Universal Extension format

The extension output provides the following informationfollows the standard Extension output format, providing:

  • “exit_code“, “status“, “status_description“: General info regarding the task execution.

  • “invocation” >

    • “fields”: The task configuration used for this task execution.

    “result”>“definitions

Result fields

title
Expand


Code Block
"exit_code": 1,
    "status": "SUCCESS",
    "status_description": "import from Git Repository executed successfully.",
    "invocation": {
        "extension": "ue-jobs-as-code",
        "version": "1.1.0",
        "fields": { ... }
    },
	"result": {
		"definitions_selected": {
            "agentcluster": 0,
			"bundle": 0,
			"businessservice": 0,
			"calendar": 1,
			"databaseconnection": 0,
			"emailconnection": 0,
			"peoplesoftconnection": 0,
			"sapconnection": 1,
			"snmpmanager": 0,
			"customday": 0,
			"emailtemplate": 0,
			"script": 0,
			"task": 2,
			"trigger": 1,
			"variable": 1,
			"virtual": 0
		},
        "definitions_added": {
			"agentcluster": 0,
			"bundle": 0,
			"businessservice": 0,
			"calendar": 1,
			"databaseconnection": 0,
			"emailconnection": 0,
			"peoplesoftconnection": 0,
			"sapconnection": 1,
			"snmpmanager": 0,
			"customday": 0,
			"emailtemplate": 0,
			"script": 0,
			"task": 2,
			"trigger": 1,
			"variable": 1,
			"virtual": 0
		},
        "definitions_removed": {
			"agentcluster": 0,
			"bundle": 0,
			"businessservice": 0,
			"calendar": 1,
			"databaseconnection": 0,
			"emailconnection": 0,
			"peoplesoftconnection": 0,
			"sapconnection": 1,
			"snmpmanager": 0,
			"customday": 0,
			"emailtemplate": 0,
			"script": 0,
			"task": 2,
			"trigger": 1,
			"variable": 1,
			"virtual": 0
		},		
        "definitions_modified": {
			"agentcluster": 0,
			"bundle": 0,
			"businessservice": 0,
			"calendar": 1,
			"databaseconnection": 0,
			"emailconnection": 0,
			"peoplesoftconnection": 0,
			"sapconnection": 1,
			"snmpmanager": 0,
			"customday": 0,
			"emailtemplate": 0,
			"script": 0,
			"task": 2,
			"trigger": 1,
			"variable": 1,
			"virtual": 0
		},		
	
errors: [] } }
Failed Execution
Expand
title
	errors: []
	}
}



Description (Failed Execution)

Example (Failed Execution)

Standard Universal Extension format

The extension output follows the standard Extension output format, providing:

  • “exit_code“, “status“, “status_description“: General info regarding the task execution.

  • “invocation”

    • “fields”: The task configuration used for this task execution.

Result fields

  • “result”

    • “definitions_selected”: The UAC definitions that match the filter provided.

    • “definitions_exported”: The UAC definitions that exported to the Git provider.

    • “errors”: The list of errors occurred during execution.


Code Block
{
    "exit_code": 21,
    "status_description": "Some errors where produced during data synchronization process:
Task completed with failures.See Extension Output for more details.",
    "status": "FAILED",
    "invocation": {
        "extension": "ue-jobs-as-code",
        "version": "1.2.0",
        "fields": {...}
    },
    "result": {
        "definitions_selected": {
            "agentcluster": 0,
            "businessservice": 0,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 1,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "definitions_added": {
            "agentcluster": 0,
            "businessservice": 0,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 0,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "definitions_modified": {
            "agentcluster": 0,
            "businessservice": 0,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 0,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "definitions_removed": {
            "agentcluster": 0,
            "businessservice": 0,
            "bundle": 0,
            "calendar": 0,
            "databaseconnection": 0,
            "emailconnection": 0,
            "peoplesoftconnection": 0,
            "sapconnection": 0,
            "snmpmanager": 0,
            "customday": 0,
            "emailtemplate": 0,
            "script": 0,
            "task": 0,
            "trigger": 0,
            "variable": 0,
            "virtualresource": 0
        },
        "errors": [
            "Failed to add UAC definition TestScript: Create script failed.
A duplicate value has been detected. Name must be unique."
        ]
    }
}


STDOUT

All definitions matched the selection criteria, in table format.

expand


titleSTDOUT Example
Code Block
=================  =========  =========================================  ===========================================================  ========
Type               Subtype    Name                                       Git Path                                                     Status
=================  =========  =========================================  ===========================================================  ========
Business Services  -          jobs-as-code-win                           Business Services/jobs-as-code-win.yaml                      imported
Tasks              Manual     jobs-as-code-manual-task-win               Tasks/Manual/jobs-as-code-manual-task-win.yaml               imported
Scripts            Data       TestScript                                 Scripts/Data/TestScript.yaml                                 failed
=================  =========  =========================================  ===========================================================  ========


Input Fields

The input fields for this Universal Extension are described below.

Field

Default value

Type

Required

Description

Introduced In Version

Information

Action

List UAC Definitions

Choice

Required

Action performed upon the task execution. Available actions are as follows.

  • List UAC Definitions

(default)
  • Export to Git Repository

  • Import from Git Repository

Introduced in

1.0.0

Universal Controller URL

-

Text

Required

The Universal Controller URL will be used to query and import UC Definitions.

Introduced in

1.0.0

Universal Controller Credentials

-

Credentials

Required

Universal Controller credentials that provide access to the Universal Controller Web Services.

The user should be configured with "Web Service Access=True".

Introduced in

1.0.0

UC SSL Certificate Verification

Checkbox

True

Boolean

Required

Enables/Disables certificate verification against Universal Controller URL. For example, if self-signed certificates are used to connect with UAC

.Default setting is checked

.

Introduced in

1.0.0

Selection Method

Business Service

Choice

Checkbox

Required

Select or filter specific UC Definitions for listing or exporting to Git repository. 
The available options are as follows.

  • Business Service

(default)
  • Bundle

  • Definition Name (Regex)

  • Workflow

  • Trigger

Visible only when the selected action is List UAC Definitions or Export to Git Repository.

Introduced in

1.0.0

Selection Name

-

Dynamic Choice

Required

The corresponding filter value for the Selection Method Field. When the selected Selection Method is Definition Name, the value provided in the
field works as a filter applied on UC Definitions name. The value should be a regex as well as a free text. For example, if the selection name is
"jobs-as-code" then all the definitions that contain this name will be listed. On the other hand, if the value is ".*" then the all supported definitions
of UC will be listed (or exported).

Visible only when the selected action is List UAC Definitions or Export to Git Repository.

Introduced in

1.0.0

Selection Exclude List

-

Choice

Optional

Exclude various UC Definition types of resources from the selection.

Visible only when the selected action is List UAC Definitions or Export to Git Repository.

Introduced in

1.0.0

Git SSL Certificate Verification

True

Checkbox

Boolean

Optional

Enables/Disables certificate verification against Git Service Provider URL. 

Visible only when the selected action is Import from Git Repository or Export to Git Repository

.Default setting is checked

.

Introduced in

1.0.0

Git Service Provider

GitLab

Choice

Optional

The Git service provider the task is using.
The available options are as follows.

  • GitLab

(default)
  • GitHub

  • Bitbucket

  • Azure DevOps 

Visible only when the selected action is Import from Git Repository or Export to Git Repository.

Introduced in

1.0.0

Git Service Provider URL

-

Text

Optional

The Git service provider URL the task is using. 

Examples for each Git Provider Version:

Visible only when the selected action is Import from Git Repository or Export to Git Repository.

Introduced in

1.0.0

Git Credentials

-

Credentials

Optional

The credentials that should be used to access the Git repository. The Credentials definition should be as follows.

  • A username of your choice is "Runtime username".

  • Git Service Provider "Token" as "Token".

Visible only when the selected action is Import from Git Repository or Export to Git Repository.

Introduced in

1.0.0

Git Repository

-

Dynamic Choice

Optional

The repository the task will use to import or export UAC Definitions. The list of values is retrieved from the Git Service Provider.
Accepts also UC variables set with Set Variable Action

Visible only when the selected action is Import from Git Repository or Export to Git Repository.

Introduced in

1.0.0

Git Repository Branch

-

Dynamic Choice

Optional

The repository branch that the task will use to import or export UAC Definitions. The list of values is retrieved from the Git Service Provider.
Accepts also UC variables set with Set Variable Action

Visible only when the selected action is Import from Git Repository or Export to Git Repository.

Introduced in

1.0.0

Git Repository Path

-

Text

Optional

  • For Export: Specify a specific path in a repository as a target.

  • For Import: validate the Git files against the Git folder path they belong to, or leave them empty for no validation.

Visible only when the selected action is Import from Git Repository or Export to Git Repository.

Introduced in

1.0.0

Git Repository File Format

Yaml

Choice

Required

The file format is used to read and write in the Git repository. The available options are as follows.

  • Yaml

(default)
  • JSON

Visible only when the selected action is Import from Git Repository or Export to Git Repository.

Introduced in

1.0.0

Git Commit Message

-

Text

Optional

The optional git commit message for the commits that will take place during export. The commit message
that will be displayed in the Git provider will have [uac push] as prefix.

For example, if the commit message is "test export" the
resulting commit message that will be displayed on the Git

provider will be "[uac push] test_export".To adjust the default prefix, use the Feature Flag UE_FF_DISABLE_DEFAULT_COMMIT_PREFIX

provider will be "[uac push] test_export".

Visible only when the selected action is Export to Git Repository.

Introduced in

1.0.0

Add UC Definitions List

-

Text

Optional

The comma-separated list of Git file paths that should be used to create UC Definitions. Type "*" to select all files from Git provider and 
add them to UAC.
Accept UC variables as input.

Visible only when the selected action is Import from Git Repository.

Introduced in

1.0.0

Modify UC Definitions List

-

Text

optional

The comma-separated list of Git file paths that should be used to modify UC Definitions. Type "*" to select all files from Git provider and 
modify the corresponding definitions of UAC.
Accept UC variables as input.

Visible only when the selected action is Import from Git Repository.

Introduced in

1.0.0

Remove UC Definitions List

-

Text

Optional

The comma-separated list of Git file paths that should be used to remove UC Definitions. Type "*" to select all files from Git provider and 
remove the corresponding definitions of UAC.
Accept UC variables as input.

Visible only when the selected action is Import from Git Repository.

Introduced in

1.0.0

Proxy Type

-- None --

Choice

Optional

What type of proxy is in use (if any). The available options are as follows.

  • -- None

(default)
  • --

  • HTTP

  • HTTPS

  • HTTPS With Credentials

Introduced in

1.0.0

Proxy

-

Text

Optional

Proxy server and port.

Introduced in

1.0.0

Proxy Credentials

-

Credentials

Optional

Credentials to be used for the proxy when the selected Proxy Type is HTTPS With Credentials.

Introduced in

1.0.0

Proxy CA Bundle File

-

Text 

Optional

The path to a custom certificate bundle to use when establishing SSL/TLS connections with proxy.

Visible only when the selected Proxy Type is HTTPS With Credentials.

Introduced in

1.0.0

Webhook Payload

-

Text

Optional

Through this field the user can provide the Bitbucket webhook payload from which the task executed will extract the Added, Modified, and Removed Definition Lists.

Note: Pass the webhook payload in this field only when integrating with Bitbucket. For all other Git webhook integrations, use the other three Definitions' List fields.

Introduced in

1.1.0



Output Fields

Field

Type

Default Value

Description

Introduced in Version

 Extension status

 Text

-

 Through this field, the user will be able to receive info about the internal status of execution, more detailed than the general task execution result code.

Based on the status of the execution this field will be updated as follows:

  • When listing resources: “List UAC Definitions“

  • When Import is in progress: “Importing UAC Definitions“

  • When Export is in progress: “Exporting UAC Definitions“

  • When at the end of the execution there is at least one failure: “Finished with errors“

  • When at the end of the execution there is no failure: “Finished“

 1.1.0

...

The exit codes for this Universal Extension are described below.

Exit CodeStatus Classification CodeStatus Classification DescriptionStatus Description
0SUCCESSSuccessful ExecutionSUCCESS: Task Executed successfully.
1FAILFailed ExecutionFAIL: Task Failed to execute with error(s)
10CONNECTION_ERRORFailed Execution“Connection failed for API: <url>“
11CONNECTION_AUTH_ERRORFailed Execution“Auth failed for action: <action details>, on API: <url>“
20DATA_VALIDATION_ERRORFailed Execution“Incorrect Field Data, see STDERR for more details“
21DATA_SYNC_ERRORFailed Execution“Some errors were produced during the data synchronization process: Task completed with failures. See Extension Output for more details."

...

For example, execution of an Export to Git Repository Action for a workflow that has three tasks inside and belongs to a business service called 'jobs-as-code' will lead to the table below:


                                                                                                                                                                  Example of STDOUT


How To

Import Universal Template

...

Modifications of this integration, applied by users or customers, before or after import, might affect the supportability of this integration. For more information refer to Integration Modifications.

Dependencies Manual Installation

...

.

Dependencies Manual Installation

On the Universal Agent that should execute this integration, perform pip install on the following libraries:

...

For a new Universal Task, create a new task, and enter the required input fields.

Integration Modifications


Integration Modifications
Anchor
Anchor
integration_modifications
integration_modifications

Integration Modifications


Modifications applied by users or customers, before or after import, might affect the supportability of this integration. The following modifications are discouraged to retain the support level as applied for this integration.

...

Users and customers are encouraged to report defects, or feature requests at Stonebranch Support Desk.

Document References


Anchor
references
references
Document References


This document references the following documents.

Universal Tasks
Document LinkDescription
Universal TemplatesUser documentation for creating, working with and understanding Universal Templates and Integrations.
Universal Event Template Use documentation for creating Universal Event Templates
User documentation for creating Universal Tasks in the Universal Controller user interface.
CredentialsUser documentation for creating and working with credentials.
Resolvable Credentials Permitted PropertyUser documentation for Resolvable Credentials Permitted Property.

Changelog

...

ue-jobs-as-code-2.0.0 (2024-03-21)

Breaking Changes

Enhancements

...

Added: When Action is 'Export to Git Repository' commit all selected definitions with a single commit (#36044).

...

User documentation for creating Universal Tasks in the Universal Controller user interface.
CredentialsUser documentation for creating and working with credentials.
Resolvable Credentials Permitted PropertyUser documentation for Resolvable Credentials Permitted Property.

Anchor
changelog
changelog

Changelog

ue-jobs-as-code-1.2.1 (

...

2024-01-

...

25)

Fixes

ue-jobs-as-code-1.2.0 (2023-12-24)


Enhancements

...

ue-jobs-as-code-1.1.0 (2023-11-09)

Enhancements

...

...