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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

161 views 0 5
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