Forums

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

Change issue visibility on transition

Mo Abbas
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 28, 2021

Hi,

I wanted to ask if anyone knows of a way we can change the visibility of an issue based on a certain status, i.e issue isn't visible for a wider group until after it's been transitioned to a specific status by the approvals team?

 

Thanks!

2 answers

2 votes
Ioana
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.
May 28, 2021

Hi Mo,

You can create an issue security scheme and have a security level where only the approvals team is part of (use a group or a project role a user/group picker custom field).

You can default that security level for all issues and have a postfunction on the transition(s) to that status to remove the security level.

Once you create an issue security scheme, you can use it via Security Level field.

Regards,

Ioana

0 votes
Ilya Stekolnikov
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.
May 28, 2021

We use scriptrunner plugin and some groovy scripts 

on postfunction use (look at screenshot)

----first postfunction

import com.atlassian.jira.component.ComponentAccessor
def cfSelect = ComponentAccessor.customFieldManager.getCustomFieldObject(12508) //Custom field CanBrowseGroup Assign

issue.setCustomFieldValue(cfSelect, null) //disallow browse for all

then if we need add someone to browse 

----second postfunction

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.link.IssueLinkManager

def issueLinkManager = ComponentAccessor.getComponent(IssueLinkManager)

def ApprovG = ComponentAccessor.getGroupManager().getGroup("Approve-group")
def TransitionPerm = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName('CBG Dev')

issue.setCustomFieldValue(TransitionPerm, [ApprovG]) // Сразу топам даем широкие права

def CEO = ComponentAccessor.getGroupManager().getGroup("Group-CEO")
def BuhSup = ComponentAccessor.getGroupManager().getGroup("Group-BuhSupervisor")
def Reception = ComponentAccessor.getGroupManager().getGroup("Group-Reception")
def BuhOpl = ComponentAccessor.getGroupManager().getGroup("Group-BuhTeam-Oplata")
def BuhClose = ComponentAccessor.getGroupManager().getGroup("Group-BuhTeam-ClosingDosc")
def SZPman = ComponentAccessor.getGroupManager().getGroup("Group-SZP-Manager")
def ServiceDir = ComponentAccessor.getGroupManager().getGroup("Group-CSO")
def HReduMan = ComponentAccessor.getGroupManager().getGroup("Group-HRTeam-EduMan")
def HRKaddr = ComponentAccessor.getGroupManager().getGroup("Group-HRTeam-KadrSpec")


def ViewPerm = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName('CBG User')


issue.setCustomFieldValue(ViewPerm, [CEO, BuhSup, Reception, BuhOpl, BuhClose, SZPman, ServiceDir]) //Сетим всех кому нужно видеть что запускает ресепшн на оплату


issueLinkManager.getOutwardLinks(issue.getId()).each { linkedIssue ->
String issueType = linkedIssue.destinationObject.issueTypeObject.name
log.info ('Issuetype: '+ issueType)

if (issueType == "Training or Business Travel"){
log.info ('In Linked Training or BT Detected')
issue.setCustomFieldValue(ViewPerm, [CEO, BuhSup, Reception, BuhOpl, BuhClose, SZPman, ServiceDir, HReduMan, HRKaddr]) //Если это командировки и обуч - исключаем ServiceDir и добавляем HR
}
}

Transition_ TBT For Approval - Jira 2021-05-28 16-57-46.png

Suggest an answer

Log in or Sign up to answer