a colleague asked me to create a workflow in which there is an initial status which should be visible only to her, not to the other users defined in the project workflow.
So I searched for a solution and I finally read some KBs speaking about post functions script working with security permissions.
We have script runner as plugin, so I defined a post function after the initial "issue create" as suggested in one post (you can see the code in the attachment), in order to make the initial state only visible to users belonging to a Group ("analisti" is the name of the Group), but this is not working as expected.
Infact a user which should not be able to see the issues created, is instead able to see them.
Where am I wrong?
Have you any suggestions to share with me?
Thanks in advance.
Hi @Marco_Barbaro ,
Once you have linked the issue security scheme to the project, you can indeed use the following scritrunner postfunction :
with this condition code :
def groupManager = ComponentAccessor.getGroupManager()
and select the appropriate issue security level. In the following transition you will have to set the security level to "all users" so they can see the issue again.
perhaps I have mistaken something because I already did what you suggested but it is not working.
I have modified post function of "Create Issue" as suggested with your code, setting a issue security scheme where the users granted are the ones belonging to "analisti".
User "zanni" is not in "analisti" group but if I create an issue with another user belonging to "analisti", "zanni" is able to see the issue and comment it.
"zanni" is the project lead, so I modified project settings in order to make the "default assignee" unassigned, but this didn't modify the behaviour I'm describing.
What do you think about it?
We'd like to introduce "zanni" to the issue only after a status change, from the initial one I'm talking about to the next in the workflow...
In fact this has been confusing for myself as well. If I understood correctly when the issue is in the first status only users in "analisti" should be able to see the issue right ? In that case define the security level as follows (replace BAL with analisti)
Then use this post function :
Only users in the group "BAL" will be able to view the issue :
you have understood my problem, thanks, but still got no working solution.
I'll attach a few screenshot.
I defined a issue security scheme as suggested, then modified "Create Issue" post function as your in screen, but "zanni" is still able to see new issues.
Please note that "analisti" group does not contain "zanni".
Where am I wrong?
yes! This seems to do the trick I was missing.
So, I defined two security levels: one only for "analisti" group and a second for "anyone".
I added a post function pointing to the second security level to the transition which goes outside from the initial state.
This way the user "zanni" didn't see the issue after its creation :)
I'll do some other tests, but I think it works now.
Thanks again Antoine!!
I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events