Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira Service Desk Customer Portal cannot approved

Hi, I cant seem to approve my ticket from the customer portal although I can see the approved button in the ship service desk. I trying to set the jira service desk to not allow reporter to approve, but it also don't allow other user to approve in the portal

 

I set the approval.condition.type to boolean and approval.condition.value to true. Below is my script. It seems working in the Service Desk but not in Portal.

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.roles.ProjectRoleManager

def projectManager = ComponentAccessor.projectManager
def projectRoleManager = ComponentAccessor.getComponent(ProjectRoleManager)
def user = ComponentAccessor.jiraAuthenticationContext.getLoggedInUser()
def reporter = issue.get("reporter")
def approvers = issue.get("customfield_12100")

def allProjects = projectManager.getProjects()
def adminProjects = []
def reporterProjects = []

allProjects.each{
def projectRoles = projectRoleManager.getProjectRoles(user, it)
if(projectRoles.find(){it.getName() == "Administrators"}){
adminProjects.push(it.key)
}
def reporterRoles = projectRoleManager.getProjectRoles(reporter, it)
if(reporterRoles.find(){it.getName()}){
reporterProjects.push(it.key)
}
}

for(int a = 0; a < approvers.size(); a++){
if(currentUser.getName() == approvers[a].getUsername()) {
for(int r = 0; r < reporterProjects.size(); r++){
if(reporterProjects[r] != "TOSD") {
for(int ad = 0; ad < adminProjects.size(); ad++){
if(adminProjects[ad] != "TOSD") {
if(adminProjects[ad] == reporterProjects[r]) {
return true
}
}
}
}
}
}
}


return false

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

Announcing Jira Service Management!

Hello there Cloud Community members! Today, we’re thrilled to announce Jira Service Management, the next generation of Jira Service Desk. Jira Service Management touts advancements in IT service ...

2,227 views 28 39
Read article

Community Events

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

Events near you