Hi,
Is there any way we can restrict entering the time in parent issue ? I would like to time spent restrict, if subTask available.
We can use in workflow by entering the below property value but it will disable completely. It will not check for subTask available or not.
jira.permission.work.denied
We need to allow if there is no subTask for issue.
Any advise.
Thanks,
Om
You can try using the "Hide System or plugin UI Element" script fragment.
Hi @Peter-Dave Sheehan Thanks you for the reply.
I tried with the following condition. I am specifying the project and issue type to narrow down the condition but it is not working. Log work is still visible and accepted logging the hours even subTask available or not.
If the user story has subtasks then log hours shouldn't be accepted at user story.
(jiraHelper.project?.key == "JIRAPOJ" && issue.issueType.name == "User Story" && issue.subTaskObjects.size() > 0)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The condition block in the "hide system or plugin ui" does not specify when you want to hide the item. It specifies when you want to show it. So you want to return True most of the time and False, when you want the item to be hidden.
Right now, you are returning True on a specific project when the issue has subtask.
It will be hidden for all other projects and situations. So you should put a ! before your parenthesis.
But also, I missed one item in the "Hide waht" (because it was disabled in my environment)... you need the following 2:
The first hides the menu item in the issue More menu.
The second hides the + sign on the time tracking panel on the right
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Peter-Dave Sheehan I agree to keep ! before the condition and I have added log-work to disable from more menu. Even though it is not hiding log work option
!(jiraHelper.project?.key == "OP" && issue.issueType.name == "User Story" && issue.subTaskObjects.size() == 0)
Is anything wrong in my condition?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Look like I figured it out the condition. I used following condition to make it work. Thank you so much Peter for your help on this.
!(jiraHelper.project?.key == "OP" && issue.issueType.name == "User Story") && !(jiraHelper.project?.key == "OP" && issue.subTaskObjects.size() == 0)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you can clean up that condition ... try this:
jiraHelper.project?.key != "OP" ||
issue.issueType.name != "User Story" ||
issue.subTaskObjects.size() == 0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.