Notifications coming from Service Desk appear to use the project portal name as the 'from' address.
How can I retrieve this value in ScriptRunner?
You would need to use something like this:]
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.servicedesk.api.portal.Portalimport com.atlassian.servicedesk.api.portal.PortalServicedef portalManager = ComponentAccessor.getOSGiComponentInstanceOfType(PortalService)Portal targetPortalResult = portalManager.getPortalForProject(user, project).right()targetPortalResult.getName()
Where user is an instance of ApplicationUser and project is an instance of Project.
Mind you, the user must have access rights to this portal, or else this will fail.
Cheers!
Dyelamos
It looks like you're new here. Sign in or register to get started.