Temporary permission change Edited

Hi, I would like to make script where if speciffic person will take a days off (holiday) everyone else in service desk project will not be able to assign him to any issue. I wanna make a new project, let's say i will name it "worker holidays" and if i will assigne someone who goes to holiday to this issue and i will set the start date and end of his holiday so no one from the main service Desk will not be able to assign him during his holiday. When he gets back, he will get earlier permissions 

 

So my questions is, is there any possibility to change the permissions for a temporary time?. Maybe you have another idea to make this possible in jira core.

 

Reegards

1 answer

I'll start off by saying that I am not a JIRA administrator by any means. However, I think a naive solution to this problem is to create a new user group in JIRA for those on holiday. If they're on holiday, add them to the "holiday-users" group.

Then, you could simply add a validator to the workflow which will prevent anyone from assigning an issue to that person:

import com.atlassian.jira.component.ComponentAccessor
def groupManager = ComponentAccessor.getGroupManager()
!groupManager.isUserInGroup(issue.assignee?.name, 'holiday-users') 

When they're back from holiday, just remove them from the group. There will be no need to change the script or mess with an end date and start dates. 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

176 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you