Exception when adding new entrie "Issue Creation Settings" in service desk (OD-410)
bufferUnderrun opened 4 years ago

last settings throw exception in service desk

image.png

image_2.png

The only groovy script we have is : image_3.png

  • bufferUnderrun changed title 4 years ago
    Previous Value Current Value
    Exception when adding new entries "Issue Creation Settings" in service desk
    Exception when adding new entrie "Issue Creation Settings" in service desk
  • Robin Shen changed state to 'Closed' 4 years ago
    Previous Value Current Value
    Open
    Closed
  • Robin Shen commented 4 years ago

    OneDev tries to evaluate the default value for field Assignees when adding the issue creation setting. Since there is no project context at this point, your groovy script needs to be improved like below:

    import io.onedev.server.model.*
    	
    def project = Project.get()
    if (project != null) {
    	def owners = project.userAuthorizations.findAll {it->it.role.owner}*.user.name
    	owners += project.groupAuthorizations.findAll {it->it.role.owner}*.group.members.flatten()*.name
    	return owners.unique()
    } else {
    	return [] // or return some default assignees as necessary
    }
    
  • Robin Shen commented 4 years ago

    OneDev tries to access default value for issue field Assignee when adding the issue creation setting. At this point, Project.get() will return null. So you need to improve the groovy script like below:

    import io.onedev.server.model.*
    	
    def project = Project.get()
    if (project != null) {
    	def owners = project.userAuthorizations.findAll {it->it.role.owner}*.user.name
    	owners += project.groupAuthorizations.findAll {it->it.role.owner}*.group.members.flatten()*.name
    	return owners.unique()
    } else {
    	return [] // or return some default assignees as necessary
    }
    
  • Robin Shen changed iterations 4 years ago
    Previous Value Current Value
    5.1.0
    empty
  • bufferUnderrun commented 4 years ago

    it works, thanks !!

issue 1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
Not Found
Issue Votes (0)
Watchers (2)
Reference
OD-410
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover