Live Field Templates
Live Fields are actions that occur when an user views one of the issues screens. These scripts allow for the control of these fields in a variety of helpful ways. They add the ability to extend the permissions control within Jira as well as helping the user by pre-populating fields or automatically controlling the field options in some other way.
The templates will create the Life Fields script by adding a new configuration for Live Fields. To learn more about using Live Fields see this page.
Setting up the Live Fields Templates
Live Fields scripts are associated to individual projects. Because of this when setting up a Live Fields configuration you must select the project.
NOTE: Due to performance implications, there can only be one Live Fields script associated with a single project. This does not mean that multiple actions/scripts can not be applied to the project, it means that those actions/scripts need to be consolidated into a single script.
WARNING: If you create a new Live Fields template for a project that already has Live Fields configured the project association will be moved from the existing configuration to the new configuration. This may have undesired effects and you should always double check to see if a project is already configured to work with Live Fields.
Testing the Script
Testing the script is as simple as viewing the issue screen for which Live Fields is configured and checking to see if the desired action is performed. If not, see this page about troubleshooting Live Fields scripts for additional information.
Templates
Set value of the summary field on create
Set the value of the summary field on UI when a new issue is created. You can use this to create pre-filled fields
Inputs
Name | Required | Description |
---|---|---|
Default Summary | YES | The text that should prepopulate the summary field when creating a new issue. |
Description | NO | The description text will be added to a comment at the head of the script so other users can be informed of the purpose of the script. |
Script
if(argv["screen"] == "create") {
lfSet("summary", "This is the default summary");
}
Disable field
Disable a field in the UI when the issue page loads.
Inputs
Name | Required | Description |
---|---|---|
Custom Field | YES | The custom field that should be disabled for the user. |
Description | NO | The description text will be added to a comment at the head of the script so other users can be informed of the purpose of the script. |
Script
lfDisable("customfield_10204");
NOTE: The custom field id (customfield_10204) is an example, the id of custom fields will be unique for every Jira instance. To check the id for a custom field see more information about the Custom Field Usage tool included in Power Scripts.
Hide field
Hide a field from the UI when the issue page loads.
Inputs
Name | Required | Description |
---|---|---|
Custom Field | YES | The custom field that should be hidden from the user. |
Description | NO | The description text will be added to a comment at the head of the script so other users can be informed of the purpose of the script. |
Script
lfHide("customfield_10204");
NOTE: The custom field id (customfield_10204) is an example, the id of custom fields will be unique for every Jira instance. To check the id for a custom field see more information about the Custom Field Usage tool included in Power Scripts.