As a ScriptRunner Admin,
I would like to set up behaviours on issue view,
So that I can apply my business rules throughout the workflow of my issues
Pleaes comment with detailed use cases - they are very helpful!
I would like to have this feature as well. It would be somthing that we can apply a rule when a custom field has changed or edited. It has been a limitation what we can do with ScirptRunner in the JIRA Cloud. For example, we are using a formula for the Priority field based on Severity and Necessity. This behavior only limited in the Create issue screen. We would like to set the rule/behavior to update the Priority field when there is a change in Severity or Necessity after the the issue has been created.
We need this feature if without this we are not able to fully control the workflow like the example we set a default value for one of the fields with read-only and deduct the value using the scriptrunner post function after each trigger so we can limit the time of retrigger without letting other user edit the value.
Hi Folks! Wanted to give you an update on this: Atlassian is currently in progress with and as soon as they release it, we will support it in Behaviours. Thanks!
We need this feature to make fields editable during specific issue statuses (e.g. review, approval) and allow only specific group/role to edit these fields.
Edit:
Maybe it’s more relevant if I give an example. Here’s the kind of conditions that are evaluated to determine if a field should be writable, assuming transitions are also supported:
def isInGroupChangeCoordinators = groupManager.getUserNamesInGroup(groupManager.getGroup(‘coordinators’)).contains(currentUser.name)
def isProjectLead = projectManager.getProjectsLeadBy(currentUser).contains(project)
def isInGroupQA = groupManager.getUserNamesInGroup(groupManager.getGroup(‘qa-managers’)).contains(currentUser.name)
for (fieldName in [‘Description’, ‘Category’, ‘Impacted Deliverables’, ‘Fix Version/s’, ‘Assignee’,
‘D&D Alpha Outcome’, ‘D&D Beta Outcome’, ‘Transfer Outcome’, ‘Validation Outcome’])
def field =
fieldName == ‘Priority’? getFieldById(PRIORITY) :
fieldName == ‘Assignee’? getFieldById(ASSIGNEE) :
fieldName == ‘Description’? getFieldById(DESCRIPTION) :
fieldName == ‘Fix Version/s’? getFieldById(FIX_FOR_VERSIONS) :
getFieldByName(fieldName)
if (
!(
[
'Description', 'Category', 'Fix Version/s'
].contains(fieldName) && (action == 'Create' || status == '0. Created' || action == 'Scope Finished') ||
fieldName == 'Assignee' && (action == 'Create' || (isInGroupChangeCoordinators||isProjectLead) && (status == '0. Created' || status.contains('Ready to'))) ||
fieldName == 'Impacted Deliverables' && (status == '0. Created' || action == 'Initiated') ||
fieldName == 'D&D Alpha Outcome' && (status == '2. Ready to D&D Alpha' || action == 'D&D Alpha Finished') ||
fieldName == 'D&D Beta Outcome' && (status == '4. Ready to D&D Beta' || action == 'D&D Beta Finished') ||
fieldName == 'Transfer Outcome' && (status == '6. Ready to Transfer' || action == 'Transfer Finished' ) ||
fieldName == 'Validation Outcome' && (status == '8. Ready to Validate' || action == 'Validation Finished' )
)
)
{
//field.setHelpText("You don't have the permissions to edit that field.")
field.setReadOnly(true)
field.setHidden(true)
}
}
Hi @Jpatterson , any idea if we can expect this feature to be implemented this year or should I pray to Atlassian?
Hi @Vincent Roger, No need to pray to Atlassian for this :) You can expect Behaviours on Issue view this year for sure - likely in October. We’ll be sure to annouce it as soon as it’s released.
Please note that not all of the same fields will be supported on Issue view as Create view. Have a look at Atlassian’s docs to know which ones you can use first https://developer.atlassian.com/platform/forge/custom-ui-jira-bridge/uiModifications/#supported-fields-per-view
Thanks Jpatterson for the feedback!
The list of supported fields for Create screen is extensive. In contrast the View screen supports only 4 fields : priority, summary, assignee, description.
In my use case there is quite a lot of custom (paragraph) fields that need to be set as read only. So it won’t be enough. Hopefully, Issue View will catch up GIC eventually.
In the meantime, I will probably not use behaviours much and instead try to use transition screens + jira.permission.edit.denied workflow property to limit the edition of fields.