Forums

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

Disable tasks acceptation from PR author via scriptrunner

xion_admin February 5, 2018

At the moment task can be accepted by everybody (inclusive the author of the PR)
So it can be happen, when the author does not agree with the reviewer, he can just accept the task and can merge the PR.
Is there a way to disable this, so maybe only the task author can accept the task?

Maybe via scriptrunner, beacuse I didn't find anything in bitbucket.

1 answer

0 votes
adammarkham
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.
February 5, 2018

I can't find a way of doing this currently. The problem is that the task events are not cancellable, otherwise you could have had an event handler for when the task is resolved. Then you could have checked the task author with the current user in this and cancelled the event if they are not the same.

You can possibly hide the tasks using Script Fragments and more specifically the "Hide system or plugin UI element" one.

I haven't tried it myself but you may be able to use the condition to hide the tasks if the task author is different to the current user. It's a bit of a reach but it may be able to get you there.

xion_admin February 26, 2018

@adammarkham

Do you know what the name of the task button in bitbucket is?

adammarkham
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.
February 28, 2018

The create task button is a client web item fragment. This means that it is rendered client side only. Unfortunately ScriptRunner does not support hiding these kind of fragments.

Your only real option is to add a web resource with some JavaScript that hides the button. Then install it using the "Install web resource" script fragment.

xion_admin March 14, 2018

@adammarkham

So an in this javascript file, I have to hide the button.

However, how to I find out the current user is not the one who created the task?

Any example how to execute the javascript itself, because I guess we have to wait till the page was finally rendered, in order to hide the checkbox.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events