Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Sharing issue with creator

Jamil Rahimov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 15, 2020 edited

Let suppose customer wants create issue on behalf of someone and this customer has service-desk agent permission(can view issue, click buttons and so on.)

How can I share this issue with this customer?

The thing I wanna know who is customer? Current user, Reporter or who ?1.PNG

1 answer

1 accepted

0 votes
Answer accepted
Jamil Rahimov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 15, 2020 edited

I did it using this script:
It reads logged in user and then adds to the issue as Participant:

import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueInputParameters
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.user.ApplicationUser
import org.apache.log4j.Logger
import org.apache.log4j.Level
def CurrentLoggedInUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

def issue = ComponentAccessor.getIssueManager().getIssueObject("//Issue Key")

def MyLog = Logger.getLogger("com.onresolve.groovy")
MyLog.setLevel(Level.DEBUG)

MyLog.debug(CurrentLoggedInUser)
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def tgtField = customFieldManager.getCustomFieldObjects(issue).find {it.name == "Participants"}
def changeHolder = new DefaultIssueChangeHolder()
def users = []
users.add(CurrentLoggedInUser)
tgtField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(tgtField), users),changeHolder)

 

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team '25 europe, atlassian event, barcelona 2025, jira, confluence, atlassian intelligence, rovo, ai-powered collaboration, developer tools, agile teams, digital transformation, teamwork solutions, atlassian conference, product announcements

🌆 Team '25 Europe registration is now open!

Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.

Register now
AUG Leaders

Atlassian Community Events