Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,385
Community Members
 
Community Events
184
Community Groups

Cannot view the customers grouped in organization

Existing Service Desk project has customer emails stored organiszation wise.

Had to transfer some tickets to a new project created mimicking the old.

I cannot see the organisation for that customer under the 'Organization' field. It does not populate when I open the ticket and try to add the Organization 

However when I 'Add Organization' under Customers, it does populate and I have to manually add the Organization. It will then show up on the ticket as well

Is there a way to copy all the Organization from the old project to the new all at once?

Any help is appreciated

1 answer

1 accepted

4 votes
Answer accepted
Brant Schroeder
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 12, 2023

@Purvi Turakhia 

There is no delivered way to do this other than using the API to get the orgs and add them through the API.  https://developer.atlassian.com/cloud/jira/service-desk/rest/api-group-organization/#api-rest-servicedeskapi-servicedesk-servicedeskid-organization-get 

Otherwise, you would need to manually add them one at a time.

Hi @Purvi Turakhia 

I think @Brant Schroeder is right. I have just worked with the API to export all organizations and customers.

the next step to import them isnt far away. I recommend you to use postman to test the api calls and from postman you can create your preferred code for the request.

In my case that is powershell.

Just to let you now upfront: you have to get the organizations first and then get the customers in this organization. 

you cant get all customers with linked organizations in one call.

Additionally if you have a huge amount of organizations and/or customers you have to deal with paging as well.

if you need any further help with creating this API script I am happy to help. Just let me know. 

if not, then every community member is happy to see your solution. 😉

Like Purvi Turakhia likes this

Thank You @Brant Schroeder @Frederic Wolf :)

This was really helpful. I will try using the API. It will be a good exercise! 

Like Brant Schroeder likes this

Hi @Purvi Turakhia 

i Just found the Powershell scripts from few days AGO for getting all organizations and all customers within the organizations.

You just have to change the first 3 Lines and Run it.

You get 2 CSV Files: organizations.csv AND CustomerList.csv

CustomerList.csv contains ALL Customers, including the information of the related organization.

[string]$YOURTOKEN = ""
[string]$YOURSITE = ""
[string]$SERVICEDESKID = "" # NOT the projectKey. Easiest way to get the ID is by opening your JSM Portal. The INT is the ID.


# Creating the Header wih Auth Token
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", "Basic $YOURTOKEN")
$headers.Add("X-ExperimentalApi", "opt-in")


# Getting ALL Organizations
$CompleteResponse = @()
$start = 0

do {
$response = Invoke-RestMethod "https://$YOURSITE.atlassian.net/rest/servicedeskapi/organization?X-ExperimentalApi=opt-in&limit=50&start=$start" -Method 'GET' -Headers $headers
$CompleteResponse += $response
$start = $response.size + 1
} while ($response.isLastPage -eq $false)

$Organizations = $CompleteResponse.values

# Exportingg ALL Organizations
$Organizations | select id, name | export-csv -Path organizations.csv -Delimiter ';' -Encoding Default -NoTypeInformation


# Getting ALL Customers in Organizations
$CompleteResponse = @()


foreach ($Org in $Organizations) {

$organizationID = $Org.id
$organizationName = $Org.name
$start = 0

do {
$response = Invoke-RestMethod "https://$YOURSITE.atlassian.net/rest/servicedeskapi/organization/$organizationID/user?limit=100&start=$start" -Method 'GET' -Headers $headers
$response.values | Add-Member -MemberType NoteProperty -Name organizationID -Value $organizationID
$response.values | Add-Member -MemberType NoteProperty -Name organizationName -Value $organizationName
$CompleteResponse += $response
$start = $response.size + 1
} while ($response.isLastPage -eq $false)

}

# Getting ALL Customers which are Not in a Organization
$response = Invoke-RestMethod "https://$YOURSITE.atlassian.net/rest/servicedeskapi/servicedesk/$SERVICEDESKID/customer" -Method 'GET' -Headers $headers
$response.values | Add-Member -MemberType NoteProperty -Name organizationID -Value $null
$response.values | Add-Member -MemberType NoteProperty -Name organizationName -Value $null

$CompleteResponse += $response

$CompleteResponse.values | Export-csv -Delimiter ';' -Path CustomerList.csv -Encoding Default -NoTypeInformation

$CompleteResponse.values.Count

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events