Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can we put a condition on LOG WORK?

Andrei Pogorelet May 2, 2018

Hello people,

 

I was wondering if there is a way to put a condition on the ability to log work on issues.

In our example I wouldn't want people to be able to log work on issues that have a certain field empty.

Any ideas on how to achieve this?

Thanks!

1 answer

0 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 2, 2018

If you have the ScriptRunner plugin, you could use the Hide UI Web fragment. You could choose the Log Work button and add the required condition for the Log Work button to be hidden.

Andrei Pogorelet May 2, 2018

Great, however I am a green beginner with Script Runner, we have it but i have no clue how to hide the UI fragment. And honestly it may not work because some people also use the Jira Work Time plugin and log directly from there...

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 2, 2018

That is right. If you have the Jira Work Time plugin, I guess Scriptrunner will not help.

Andrei Pogorelet May 2, 2018

Maybe we can somehow no allow the loging event without if the custom field conditions isn't met? This should theoretically prevent logging from any source if the condition isn't met.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 2, 2018

You can develop a listener and listen for the Work logged event. Then you could make your logic there and handle the work log. But it would be invisible for the user. You can not return a result to the user from the listener.

Andrei Pogorelet May 2, 2018

Indeed this solution doesn't work for us. the UI solution as well. 

Can we configure some Behavior that not allow logging only if certain condition is fulfilled, like maybe remove log work permission temporarily?

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 2, 2018

No, you can not use behaviours because behaviours work only fo the Create, Edit, View and Transaction screens. They do not work for the log work screen. You could use JavaScript of course, but it is not a good approach.

Suggest an answer

Log in or Sign up to answer