how can we deal with such case via scripted validation:
1. Time can be logged only on sub-tasks.
2. Only the assignee can have time logged in the subtask, unless it is a "xxx" sub-task.
3. Time can be logged only if sub-task status is "In progress".
4. Time may enter an assignee or some project role on behalf of assignee unless it is a sub-task of the "xxx" type.
How do you rate the level of complexity?
I have noticed that I got number 4 incorrectly. You don’t want to check subtask’s status, you want to check parent task’s status. I need to work on that condition.
I have 2 more questions:
1. Can I use somehow ID of transition? Just like: 'if transition ID = “41” then allow logging work'
Will it work like e.g. in scriptrunner?
2. How can I refer to a project role and status?
for example: if projectrole = sd team then allow logging work in any status
You can use following code to access parent of an issue, in the example it retrieves parent issue status if current issue is a subtask.
Unfortunately transition ID is not available. It is only valid for workflow scripts and worklog verification is usually a separate operation.
To check whether a user is member of a specific project role:
OK, thanks. Looks good!