Skip to end of banner
Go to start of banner

SIL Context

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

When writing a SIL script that will handle an event, the username of the user who triggered the event will be available as the first element in the argv variable and you can use it like this:

string callingUser = getElement(argv, 0);

Also, the issue context (all standard variables and custom field values) will be set to those of the issue where the event was triggered from. For example, if a SIL script is triggered by an event launched from the "TST-123" issue, all standard variables and custom fields used in the SIL script will point to the "TST-123" issue, unless specified otherwise using the construction %otherIssueKey% variable.

Info

To edit the actual scripts, useSIL™ Manager.

Aside from the issue events that are configurable from Jira UI, a SIL Listener also enables you to react to other events. Note that these events will not run in an issue context since they're not related to an issue, and it doesn't make sense using standard issue variables without qualifying them with the key of the issue. Additionally, each event might add additional information to the argv variable aside from the information that is common for all events.

The first three elements in the argv string array are (note that indexing in the array starts with 0):

  1. The user that triggered the event

  2. An internal id for the event that was triggered. Normally you wouldn't need this.

  3. The name of the event as specified in the dropdown list that configures the listener.

The next elements in the array after these are event-specific and are detailed in the following table.

Event

Additional Parameters

Notes

Version Archived

4. version ID

5. string representation of aVersionstructure. You can retrieve this value and then cast it to a "Version" structure.

Version v = (Version) argv[4];

To get a structure with the changed version, use thegetVersionFromEventroutine.

Version Created

Version Moved

Version Released

Version Unarchived

Version Unreleased

Version Merged

4. version ID

5. string representation of aVersionstructure. You can retrieve this value and then cast it to a "Version" structure.

6. merged version ID

7. string representation of the merged version (cast-able to Version, similar to 5).

Even though you can merge multiple versions into one at once, Jira API only provides reference to a single merged version.

To get a structure with the merged version, you can use the following routines:getMergeToVersionFromEvent,getVersionFromEvent.

Version Updated

To get a structure with the updated version, you can use thegetOldVersionFromEventroutine.

Version Deleted

4. version ID

5. empty (the version is already deleted at this point and details are no longer available)

To get a structure with the deleted version, you can use the following routines:getMergeToVersionFromEvent,getFixVersionSwappedToFromEvent,getAffectsVersionSwappedToFromEvent.

Project Created

4. project ID

5. string representation of aProjectstructure. You can retrieve this value and then cast it to a "Project" structure

To get a structure with the created project, you can use thegetProjectFromEventroutine.

Project Deleted

4. project ID

5. project KEY (the project is already deleted at this point and details are no longer available)

To get a structure with the deleted project, you can use thegetProjectFromEventroutine.

Project Updated

To get a structure with the updated project, you can use thegetOldProjectFromEventroutine.

Component Created

To get a structure with the created component, you can use the getComponentFromEventroutine.

Component Merged

To get a structure with the merged component, you can use thegetComponentFromEventorgetMergeToComponentFromEventroutine.

Component Deleted

To get a structure with the deleted component, you can use thegetComponentFromEventroutine.

Component Updated

To get a structure with the updated component, you can use thegetOldComponentFromEventroutine.

User Created

To get a structure with the created user, you can use thegetNewUserFromEventroutine.

User Updated

To get structures with the updated user, you can use thegetNewUserFromEventandgetOldUserFromEventroutines.

User Deleted

To get a structure with the deleted user, you can use thegetDeletedUsernameFromEventroutine.

  • No labels