Forums

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

Customer Portal - Scriptrunner Share with my Organizations

Paul Tandy April 4, 2019

Hi Guys,

I need some help!

We have implemented JIRA service-desk and setup customer accounts linked to Organizations. 

When a customer creates a ticket, we require it to be shared with all the organizations that customer is assigned to automatically. 

 

I've found a script that auto assigns ALL orgs, but like I mentioned we only want the ones the current user has been assigned under.

Section to be edited:

// get all the organizations configured for that project
def organizationsToAdd = organizationService.getOrganizations(currentUser, organizationsQuery)?.right()?.get()?.results

// get the Organizations custom field
def cf = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Organizations")

// finally update the organizations custom field
cf.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(cf), organizationsToAdd), new DefaultIssueChangeHolder())

 

Full script:

https://scriptrunner.adaptavist.com/5.4.47/jira/recipes/workflow/servicedesk/email-linked-issue-watchers.html

 

Would anyone know how to edit the script in-order to return just the Orgs linked to the current assignee.

 

Thanks

Paul 

 

   

 

 

1 answer

0 votes
Peter T
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.
April 8, 2019

Hi Paul,

may I ask why you want to assign the tickets to everyone in the same org?

If this is visibility there is another solution - you can see inside the main ticket all other tickets created by users from the same org. This way you can see all other tickets filed from anyone in the org from one location.

This is explained pretty well in our documentation:

https://botronsoft.atlassian.net/wiki/spaces/ILV/pages/113541247/JQL+Extension#JQLExtension-SameOrganization

Cheers,

Peter T

Paul Tandy April 9, 2019

Hi Peter,

My company sell and distribute products to consortium's.

When a customer creates a ticket under the JIRA customer portal, they must share this with all members of their Org.  Sometimes they belong to multiple Orgs. JIRA by default doesn't auto share information when a customer is added multi Orgs. Instead the request is set to private and you can only select one Org from the dropdown list.

We require all customer Ogrs for the project added.

The script I've linked adds all project Orgs regardless of customer association.

Hope this clarifies. 

Paul

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events