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.ComponentAccessor
import com.atlassian.servicedesk.api.portal.Portal
import com.atlassian.servicedesk.api.portal.PortalService
def 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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.