Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

jira删除为物理删除,而且删除后是无法找回的,在审计日志都查不到,为了收拢权限,可以将删除菜单禁用掉,指定类型,指定人员等有权限删除

示例



代码

Code Block
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.JiraAuthenticationContext
import com.atlassian.jira.user.ApplicationUser
 
//获取登录人
JiraAuthenticationContext jiraAuthenticationContext = ComponentAccessor.getComponent(JiraAuthenticationContext.class)
ApplicationUser currentUser = jiraAuthenticationContext.getLoggedInUser()
//判断类型并且是具体登录人可以删除
if(issue.issueType?.name == 'Story'){
    return false;
	if(currentUser.getUsername()=='admin'){
	 	return true;
	}else{
	    	return truefalse;
	}
}