You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
If the manager has been deactivated we need to change this manager to the supermanager user. How to do it? Easy! We will create a trigger for the cwd_user table. And if a user is deactivated then we will update the customfieldvalue.
First we will create a pl sql procedure:
CREATE OR REPLACE FUNCTION public.changeusermanager()
IF NEW.active <> OLD.active and NEW.active = 0 THEN
update customfieldvalue set stringvalue = 'supermanager' where customfield = 10300 and stringvalue = NEW.user_name;
And now we can create a trigger:
create trigger changemanager before
public.cwd_user for each row execute procedure public.changeusermanager();
Let's check how it works. Open the User Management Jira settings and deactive the manager1 user:
Click the Update button and let's open one of our created issues:
We created a solution for our approval process and ready to inform our manager that the task has been completed!
In the next articles I will explain why these techniques are low quality and, what is most important, how to make a better quality solutions.
1,574 accepted answers