Contents
Table of Contents |
---|
Referencing an Issue
By default, the issue standard variables are pre-declared along with their synonyms. For instance,the key is an issue standard variable. You should avoid to re-declare it, since it will lead to subtle errors. We recommend you to prefix your variables with certain string if you are unsure of its name.
...
Tip | ||
---|---|---|
| ||
You will see the last construct comes in hand when used in cycles (for, while, do-while) or when creating an issue from SIL. |
Substitution
It often happens that you need the value of a variable designated by another value. For example, we might have a custom field that specifies which other field contains certain data. The general syntax for substituting variables is:
...
Code Block | ||
---|---|---|
| ||
string myCustomField = "customfield_10000"; // myCustomField is a local variable %myCustomField% = "a value"; |
Standard Variables
Here is a list of the variables that are already defined in a SIL environment and which you can use right away. Note that these are all standard issue fields.
...
Variable | Aliases | Type | Readonly | Explanations and Usage |
---|---|---|---|---|
affectedVersions | affectedVersion | string [] | no | The affected versions field of the issue. If attempting to add an invalid value, it will be ignored. |
assignee | - | string | no | The assignee of the issue. Represents the username, not the real name. |
attachments | attach | string [] | yes | The filenames of the attachments. There are routines to modify those |
components | component | string [] | no | The components of the issue. If attempting to add an invalid value, it will be ignored. |
created | - | date | no | The date when the issue was created. |
description | desc | string | no | The description of the issue. |
dueDate | due | date | no | The due date of the issue. |
estimate | est | interval | no | This is displayed as "Remaining" in the Jira interface. Requires TimeTracking. |
environment | env | string | no | The environment of the issue. |
fixVersions | fixVersion | string [] | no | The fix versions field of the issue. If attempting to add an invalid value, it will be ignored. |
id | - | number | yes | The id of the issue. |
issueType | type | string | no | The name of the issue type. |
issueTypeId | - | string | no | The id of the issue type. |
key | - | string | yes | The key of the issue. |
labels | - | string [] | no | The labels of the issue. |
originalEstimate | origEstimate | interval | no | The original estimate of the issue. Requires TimeTracking. |
parent | - | string | no (yes, since 1.4.3) | The key of the parent issue. |
parentId | - | number | no (yes, since 1.4.3) | The id of the parent issue. |
priority | prio | string | no | The name of the priority. |
priorityId | - | string | no | The id of the priority. |
project | prj | string | no | The key of the project. |
projectId | - | number | no | The id of the project. |
reporter | - | string | no | Represents the username, not the real name of the reporter. |
resolution | res resol | string | no | The name of the resolution. When set will also modify the resolution date. |
resolutionDate | - | date | no | The current resolution date. If the resolution is modified, the date will also be updated. |
resolutionId | resId resolId | string | no | The id of the resolution. When set will also modify the resolution date. |
securityLevel | security | string | no | The name of the security level. |
securityLevelId | securityId | number | no | The id of the security level. |
status | - | string | yes | The name of the status. |
statusId | - | string | yes | The id of the status. |
summary | - | string | no | The summary of the issue. |
timeSpent | spent | interval | no | The time spent (logged work) on the issue. Requires TimeTracking. |
updated | - | date | yes | The date when this issue was last updated. It will update automatically after the current transition. |
votes | - | number | no | The number of votes this issue has. |
watchers | - | string [] | no | The watchers of the issue. The elements in the array are usernames. |
workflow | wrkflw | string | no (yes, since 1.4.3) | The workflow name of the issue. |
workflowId | - | number | no (yes, since 1.4.3) | The workflow id of the issue. |
Custom Fields
Aside from the standard issue fields, you can also access custom fields from SIL in one of three ways:
...
Note | ||
---|---|---|
| ||
If you have multiple custom fields with the same name, the JIRA API returns the first one it finds. |