How to Bulk add Organizations and Customers in Service Desk Cloud?

Michael Dennis October 19, 2016

I have read this fairly limited article and can find no other more detailed articles - https://confluence.atlassian.com/display/CONFEVAL/JIRA+Service+Desk%3A+Bulk+Add+Customers and it suggests that a bulk add of Customers is possible via the UI by pasting in a CSV file.  I say seems to, because of this brief comment "Alternatively, you can invite customers in bulk, adding multiple emails at once when inviting. You can copy/paste from a .csv, as they should parse into the invite window."  Key word there is "should".

Using the UI to do a .CSV file import just seems like a kludge, is there really no import from file option?

That article does not meet my goals, which are:

  1. Bulk create create a new Organizations, along with the associated Customers (what I'd call contacts).  This would be a One to Many relationship.  One Organization with Multiple Customers, and allow me to have a long list of Organizations.
  2. It also seems that this will immediately invite each Customer to the portal.  Is that true?  What is needed is that they are all created with NO emails being sent.  This would allow us to review them prior to the invite email being sent out.  Secondly it would allow us to invite a subset of the imported Customers on a phased roll out approach.  

Hopefully, someone will point me to how to do both of these (#1 being the most important).

Many thanks in advance!

Michael

 

5 answers

1 accepted

7 votes
Answer accepted
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 19, 2016

Michael,

if you have all of the customer's emails in a spreadsheet simply select them all, copy and paste into your "add customer" pop up. you can do the same to add customers into an Organization you created. At least it worked for me.

Michael Dennis October 19, 2016

Let me make sure I understand what currently worked for you based on that.  The Organizations need to be manually created?  Once they exist, then the list of Customers can be imported via the UI?

Or is there a way in the xls (or CSV) to specify which Organization they belong to?

Did that immediately send them an invite email?

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 19, 2016

Yes, manually created. See if the following works.

If you have a spreadsheet that has all the customers listed AND if you have the organization, they belong to then do the following:

  1. Manually add the organizations in JSD project via customer page>Add organizations. I expect there are not that many.
  2. sort your spreadsheet by organization and copy all user in say Org-A
  3. in JSD go to the customer page and click Add customers
  4. in the pop up paste the customers and then choose which org they will go into.
  5. repeat 3-4 for each Organization you have defined.

I believe invites are sent when you use "Add customers". I suggest you test adding a single customer to verify that if it is important.

Important: If you do not want email notifications to be sent to all users in an organization when a request is created then before doing the above disable this feature - Project> Project Settings> Customer Notifications> Organization added (edit and disable this)

Like # people like this
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 19, 2016

BTW, if the customers already exist in the JSD project then you can add them to the organization in a similar copy&paste means. Just select the Organization in the customer list and then select Add customers on the organization page. What happens is that these customers are moved out of the generic customer list and 'into' the organization.

Like # people like this
Dana Breakstone September 21, 2017

Thanks for that last response for adding already created customers to an org. Was trying to figure this out for a while!

Bjoern Veith May 28, 2019

Hi I tried it, but if I copy the list of organisations into the the Add organization field, JIRA does not recognize the separator. Any help?

Like Luanna Gobbato likes this
Miriam Hopton May 13, 2020

You rock, Jack! THANK YOU!!

Alex December 5, 2020

@Jack Brickey 

BTW, if the customers already exist in the JSD project then you can add them to the organization in a similar copy&paste means. Just select the Organization in the customer list and then select Add customers on the organization page. What happens is that these customers are moved out of the generic customer list and 'into' the organization.

Sorry Jack, but this does not work for me.

Just select the Organization in the customer list

This leads to me the organization page with the info "no customers yet".

and then select Add customers on the organization page

This open the popup to enter usernames or email addresses (empty).

So where do I copy my all of my existing customers from? In your description this somehow magically happens by itself.

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 5, 2020

Alex, sorry if my answer was unclear.  What I mean is that you can follow the original process where you start with a CSV list. So the pre-requisite here is that you have access to this data outside of JSM. 

Alex December 5, 2020

Thanks for your reply. Ok, so I ripped your answer out of context and therefore misunderstood it, my fault.

But is there no way to bulk add customers (existing system customers = user with a jira account) to an organization? I mean, they are there, I just need to select them somehow.

I want all users of my organization to be able to see the requests of all others. Shouldn't all users be kind of a selectable group ("organization" if you like) automatically? ("internal" or something)

This way I have to add every new user manually to an "organization". I would think the organization membership should correspond to a user role/profile/group.

13 votes
Aristedes Maniatis October 27, 2016

I am in the same position and from my research it would appear this new feature of Organisations has been very poorly implemented:

 

  • Organisations are per service desk project. They do not carry across projects, so we would need to set up 2000 customers by hand separately for each of our three service desk projects.
  • There is no LDAP integration
  • There is no API
  • There is no CSV import
  • There is no integration to parts of JIRA outside ServiceDesk. Even the user profile page has no indicator for the organisation.

At this point, my opinion is that this new feature is worse than useless. Why worse? Because now plugin developers will shy away from offering functionality in this area, in case Atlassian step on their toes.

Tiffany Owen
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.
September 1, 2017

Does anyone know if there is a ticket open to request these features? LDAP integration is super important.

Susan Hauth _Jira Queen_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 1, 2017

Found one JSDCLOUD-1829

2 votes
Larry Barker August 25, 2017

Has the situation with this improved at all?  We are migrating over and I'm gobsmacked that there is no way to import users linking them to their appropraite ORG and Full Name.  As well as being able to turn off notifications/invites to the users after you add them.

There has to be a better way.  As stated in the last reponse, there is no manner in which to import this essential data.   Crazy.

Simon Merrick September 25, 2017

 

Here's a script I wrote last night to bulk import ~400 customers from ~50 different organizations and put them into the right service desk / organizations.

It's a bit rough but it did the job and was much easier than doing every customer and organization by hand. Feel free to tweak / improve it.

https://gist.github.com/iokiwi/25f7b5525e8bb542dc44ac1fa02918ef

The script is based of these api docs which are current marked experimental but worked in the cloud just fine.

https://docs.atlassian.com/jira-servicedesk/REST/3.6.2/

https://developer.atlassian.com/cloud/jira/service-desk/rest/#about

Like Kat Warner likes this
Larry Barker September 28, 2017

Thank you Simon!  

I'll give this a shot.  When you used the API to do all this do you know if their system still sent out notification emails to all the customers as they were added?

Larry Barker September 28, 2017

Looking further I see that the docs stipulate that invites are not sent.  This should work perfectly for me.   Thanks again.  Now if we could only set the customer language preference via the API I'd be golden :)

Cheers.

Simon Merrick September 28, 2017

No worries. I wonder if you can see the customer language preference in the JSON returned by any kind of GET request. I'm willing to bet if you can see it in a GET you can set it in a POST. There may be something undocumented. I might look into it tomorrow

Simon Merrick October 3, 2017

Hey Larry,

I was working with one of our developers to use this with Jira Service Desk standalone server and found several issues with the script. 

First of all, in server, the experimental header is 

X-ExperimentalApi: opt-in

I also realised that I have not implemented the create_organisation() method and need to add an additional step to add the organisation to the service desk. I will update the script shortly.

Casey Carter October 4, 2017

Is there an easier way to turn off the notifications? Besides having to run the script, was the script tried on Standalone Server version?? I currently have all the organizations added, and am currently adding customers to the Org, but I am not live, and do not want to send the customers emails, because they cannot access the site. Please advise.

Dirk Schaare November 23, 2017

Same issue here - we like to prepare everything before the official go-live and do not want to send any customer notifications upfront. 

Simon Merrick November 29, 2017

Casey,

Yes it was used successfully against the latest standalone server with some minor changes

- the X-ExperimentalAPI header used X-ExperimentalApi: opt-in
- had to change between using full name and display name for users

The api is still experimental and therefore not stable. Be prepared for the api to change between versions of JSD for server, or change without warning if you are using cloud - and to tune / adapt the script to the current state of the API.

If, like me, you are not strong with cURL I have found Postman to be an excellent tool for probing - The api is generally pretty good at providing intelligible error messages when something goes wrong or the input is malformed.

Dirk,

At the time of running the script, creating orgs / customers via the api did not send invitations

Dirk Schaare November 30, 2017

I tried the script against our standalone JIRA ServiceDesk server, but got only 401 / 403. Authentication unsuccessful, but I could not narrow down what goes wrong.

Any ideas?

Thanks,
Dirk 

Simon Merrick November 30, 2017

Well 401 is unauthorised, 403 is forbidden.

https://httpstatuses.com/401

https://httpstatuses.com/403

You need to make sure the account you are using for authorisation has all the necessary permissions in jira and in the project. The API documents detail what permissions are needed to perform each operation but I think having an account with jira admin and project admin permissions mostly covers it

Do be careful doing this, its not good practice having an account with "god mode" permissions if you have the ability to elevate the permissions of the account you are using for authorisation be sure to restrict them again afterwards.

The logging could use some improvements. It may be helpful to log out the full body of the response when there is an error. eg ( logger.debug(response.body) )

I'll try to clean the script up a little bit. Like I said it was written under tight time constraints and isn't very polished, it relies on the user to be comfortable enough to troubleshoot and modify to their need accordingly 

Dirk Schaare November 30, 2017

Thanks for your Support, highly appreciated !

The user has global Administrator, Project Administrator and Services Desk Team rights/role.

I will try to debug the response.

Kurt Christoph Von Schwerin November 30, 2017

Dear @Simon Merrick

Thank you!!! Works superbly well. I do get some errors however;

ERROR -
2017-11-30 11:18:02,320 - ERROR - Failed to process row: ['Organisation', 'Test name', 'test.email.adress]
Traceback (most recent call last):
File "bulk_customer_import2.py", line 205, in main
add_customer_to_servicedesk(args.servicedesk_id, customer)
File "bulk_customer_import2.py", line 137, in add_customer_to_servicedesk
logger.info("{} was added to service desk {}".format(customer["fullName"]))
KeyError: 'fullName'
2017-11-30 11:18:02,321 - INFO - The following rows not processed
['Organisation', 'Test name', 'test.email.adress]

Regardless of the above errors.. the script functions. User gets created etc. I am just not sure what these errors actually mean and how to resolve them. Everything seems to work though.

Thanks!!

Simon Merrick March 15, 2018

Welcome. Your problems are my problems :)

Sean April 13, 2018

I was glad to find this thread, because I thought I must be missing something in the documentation.

It's April, 2018... does Atlassian have a native solution for this yet? We are looking to run the Cloud version of Service Desk and we have 15,000 customers that we would like to import into organizations based on department with SSO and WITHOUT sending email to notify them that they need to set up their account. We really do not want 15,000 people to all get messages welcoming them to Jira Service Desk. Nor do we want them to be prompted to create accounts with unique passwords (although it would be fine if they are prompted to activate a SSO account the first time they submit a ticket).

We use Office 365 and most of our cloud apps are configured for SSO using Azure, and those that do not work with Azure use LDAP or SAML. I see that Atlassian supports Azure... I think? But it sounds like that's for licensed users? Will that work for service desk customers as well?  We also have G Suite (but not Gmail) in our environment and all of our users sync over to that. It looks like there is some kind of Google directory support? 

Basically I just want an automation/service that regularly syncs the customer list with our directory and I'd like it to import the following information:

  • email
  • Full Name (or first, last)
    Location
  • Work Phone
  • Title
  • Department (mapped to organization)

I would also like this information to sync automatically since people move departments. 

In our current service desk software this process is dead simple via LDAP.  It literally took minutes to configure.

I'm also wondering if I'm thinking about this the wrong way. Why create customer accounts for thousands of people who may never use our services? Maybe it should be by demand? The problem is that we would still like to have SSO. And ideally we would also have the location, phone, department, and title info since we assign tickets by department for some situations. 

Like # people like this
SD Admin April 16, 2018

Hi Sean,

Is your question being answered or responded? We also have the same challenge with 30,000 customers in one organization and also looking for a solution. 

Side track, does anyone know where can I get information on how to bulk import the customer portal setting in Service Desk Cloud? I am also looking for quick deployment method to setup 16 customer portal via import and not creating it one by one as it is really super time consuming in each repeated click! :( Please help if someone here know the method. Thanks

Like # people like this
Louis Aguila June 3, 2019

Hi @Simon Merrick , I have this configured and I got everything working. I did have to an API token as the password as my normal password did not work and I got a 401 error. The script successfully creates the Organization and the Customer in my Service Desk, but it fails to link both of them together. 

I also see quite a bit of dropped connections and I am not sure why. 

Below is an example of my import, it seems to fail right as it is about to start linking the Customer and the Organization together. 

I am using the script from here by the way which I believe is the latest version? 

Thank you!

 

C:\Users\Louis\AppData\Local\Programs\Python\Python37-32\Scripts>C:\Users\Louis\Desktop\Jira\bulk_customer_import.py "https://mycustomer.atlassian.net" "username" "password" C:\Users\Louis\Desktop\Jira\test1.csv 30 -l debug
2019-06-03 15:50:52,987 - INFO - Initializing session
2019-06-03 15:50:52,990 - DEBUG - Starting new HTTPS connection (1): mycustomer.atlassian.net:443
2019-06-03 15:50:53,360 - DEBUG - https://mycustomer.atlassian.net:443 "GET /rest/auth/1/session HTTP/1.1" 200 None
2019-06-03 15:50:53,467 - DEBUG - https://mycustomer.atlassian.net:443 "GET /rest/servicedeskapi/organization HTTP/1.1" 200 None
2019-06-03 15:50:53,649 - DEBUG - https://mycustomer.atlassian.net:443 "POST /rest/servicedeskapi/customer HTTP/1.1" 400 None
2019-06-03 15:50:53,652 - DEBUG - Resetting dropped connection: mycustomer.atlassian.net
2019-06-03 15:50:53,914 - DEBUG - https://mycustomer.atlassian.net:443 "POST /rest/servicedeskapi/organization HTTP/1.1" 201 None
2019-06-03 15:50:53,919 - INFO - Organization 1 was successfully created
2019-06-03 15:50:54,065 - DEBUG - https://mycustomer.atlassian.net:443 "POST /rest/servicedeskapi/servicedesk/30/organization HTTP/1.1" 204 0
2019-06-03 15:50:54,066 - INFO - Organization 1 was added to service desk 30
2019-06-03 15:50:54,165 - DEBUG - https://mycustomer.atlassian.net:443 "POST /rest/servicedeskapi/organization/25/user HTTP/1.1" 400 None
2019-06-03 15:50:54,171 - DEBUG - Resetting dropped connection: mycustomer.atlassian.net
2019-06-03 15:50:54,479 - DEBUG - https://mycustomer.atlassian.net:443 "POST /rest/servicedeskapi/servicedesk/30/customer HTTP/1.1" 204 0
2019-06-03 15:50:54,597 - DEBUG - https://mycustomer.atlassian.net:443 "POST /rest/servicedeskapi/customer HTTP/1.1" 400 None
2019-06-03 15:50:54,602 - DEBUG - Resetting dropped connection: mycustomer.atlassian.net
2019-06-03 15:50:54,840 - DEBUG - https://mycustomer.atlassian.net:443 "POST /rest/servicedeskapi/organization HTTP/1.1" 201 None
2019-06-03 15:50:54,841 - INFO - Organization 2 was successfully created
2019-06-03 15:50:54,946 - DEBUG - https://mycustomer.atlassian.net:443 "POST /rest/servicedeskapi/servicedesk/30/organization HTTP/1.1" 204 0
2019-06-03 15:50:54,947 - INFO - Organization 2 was added to service desk 30
2019-06-03 15:50:55,048 - DEBUG - https://mycustomer.atlassian.net:443 "POST /rest/servicedeskapi/organization/26/user HTTP/1.1" 400 None
2019-06-03 15:50:55,057 - DEBUG - Resetting dropped connection: mycustomer.atlassian.net
2019-06-03 15:50:55,364 - DEBUG - https://mycustomer.atlassian.net:443 "POST /rest/servicedeskapi/servicedesk/30/customer HTTP/1.1" 204 0
2019-06-03 15:50:55,365 - INFO - An error occurred while processing the following rows.

Simon Merrick September 5, 2019

Hi @Louis Aguila ,

Sorry the logging is a bit crap and I cant see exactly why its failing but I can see the logs are full of HTTP 400 statuses

2019-06-03 15:50:54,165 - DEBUG - https://mycustomer.atlassian.net:443 "POST /rest/servicedeskapi/organization/25/user HTTP/1.1" 400 None

This means means the script is sending data to the server that is not formatted correctly.

The endpoints that the script uses were experimental and may have changed since I published the script.

Rob Peterson March 24, 2020

+1 for @Larry Barker for using gobsmack  LOL.

0 votes
Viktor December 10, 2019

Do we still have to manually add users without LDAP or API three years later?

Just wondering.

Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 10, 2019

it has not changed. copy and paste in a CSV.

simonmerrick December 10, 2019

It's possible via API + script. I wrote a script for this two years ago. https://github.com/iokiwi/jsd-bulk-customer-upload

I would be willing to help you use it.

Like # people like this
Andrew Tran May 1, 2020

@simonmerrick , would you be able to create a video guide on how to use this for someone who is not familiar with API scripting or python?

simonmerrick May 1, 2020

@Andrew Tran It's really designed for someone with some basic sysadmin experience.

What OS are you using on your desktop? Windows?

If you are on windows you need to

1. Install python3 - https://www.python.org/downloads/

2. Git clone repository or download a zip and unzip the file

3. In windows CMD change current work directory to the root of the repository

4. Install script dependencies with `pip install -r requirements.txt`

5. Run script  as documented https://github.com/iokiwi/jsd-bulk-customer-upload#usage

If more than half of the steps above are things you have never done before it may be best to give it to a system administrator or developer at your organization.

Iif you need more help with this maybe we can discuss terms for a couple of hours of my time to assist your organization

Andrew Tran May 6, 2020

@simonmerrick can you send your email so we can have this conversation?

 

Thanks,

Andrew

simonmerrick May 6, 2020

No Worries @Andrew Tran,

Contact me at simon.merrick@outlook.co.nz

Regards,
Simon

abhishek.singh May 17, 2021

Hello @simonmerrick ,

Thanks for your help here. 

Can we use this script on mac machine ?

 

Regards, 

Abhi

Like simonmerrick likes this
simonmerrick May 18, 2021

Yes, you can use it anywhere you can run python3 :)

Like abhishek.singh likes this
abhishek.singh May 22, 2021

Hello @simonmerrick , 

I am getting below error. 

requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))

Can you please help me on this urgently. 

 

Regards, 

Abhi

simonmerrick May 22, 2021

@abhishek.singh 

The error message you sent doesn't tell me much at all. I need some more lines on either side.

Can you please run the script with debug logging `-l debug` as per the issues section here: https://github.com/iokiwi/jsd-bulk-customer-upload#issues

And email the output to me at simon.merrick@outlook.co.nz

Regards,

Simon

abhishek.singh May 23, 2021

Hello @simonmerrick , 

Thanks, 

I am removing my comment from here.

 

Regards, 

Abhi

simonmerrick May 23, 2021
```
b64encode(('%s:%s' % (username, password)).encode('latin1')).strip()

UnicodeEncodeError: 'latin-1' codec can't encode character '\u201c' in position 0: ordinal not in range(256)

You have a non-ascii unicode character in your username or password (more likely password) that the requests library doesn't know how to encode.

The problem character is `\u201c` which according to this  is a 'LEFT DOUBLE QUOTATION MARK'

I wouldn't have thought it would cause that much of an issue but my recommendation would be to change your password to something not containing \u201c or other non-ascii characters and try again.

If you need further assistance I urge to to send output like this to my email address as requested to avoid potentially leaking sensitive information such as parts of your password or your customer's PII.

Edit:  The \u201c character may not be part of your password, but if you copied and pasted your username or password into the terminal then you may have accidentally copied and pasted the \u201c along with it. This could especially be the case if you copy pasted from a Microsoft Word Document or another formatted, rich text source.

Regards,
Simon

abhishek.singh May 23, 2021

Hello @simonmerrick , 

Thank you very much for your reply.

I sent you mail with error log where I am getting error 

requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))

Please help !!!

Regards,

Abhi

0 votes
Thomas Kinateder March 7, 2018

Hi,
i have an error with the script. I have no idea whot is going wrong!
Can everybody help me, have i the right ID ?

Thank you verry much
Thomas


D:\tools\python-script>python bulk_customer_import.py "http://xxx-xxjir01:8080" "user" "password" bulk_import.txt BBK3-JPK0-0HL3-WXTG
2018-03-07 15:29:31,749 - INFO - Initializing session
2018-03-07 15:29:33,122 - ERROR - {"errorMessage":"Die Registrierung ist derzeit nicht verfügbar.","i18nErrorMessage":{"i18nKey":"cv.signup.error.not.
allowed","parameters":[]}}
2018-03-07 15:29:34,511 - ERROR -
2018-03-07 15:29:35,041 - ERROR - {"errorMessage":"Die Registrierung ist derzeit nicht verfügbar.","i18nErrorMessage":{"i18nKey":"cv.signup.error.not.
allowed","parameters":[]}}
2018-03-07 15:29:36,242 - ERROR -
2018-03-07 15:29:36,242 - INFO - The following rows not processed

Simon Merrick March 15, 2018

Hey Thomas,

"Die Registrierung ist derzeit nicht verfügbar." / "The registry is currently unavailable."

Haven't encountered this error before.

Are you on Server? Version?

This may be relevant, what do your Customer Permissions look like?

https://community.atlassian.com/t5/Jira-questions/Dont-allow-users-to-create-new-customer-account-but-enable-email/qaq-p/75878

This ticket in an issue tracker of a 3rd partly plugin provider was the only exact match for this error message I could find at a glance. Are you using this plugin?

https://jira.appcelerator.org/browse/AC-229



Simon Merrick March 15, 2018

NGL - I did a poor job reading your comment.

You are clearly on server. I think your servicedesk_id argument (BBK3-JPK0-0HL3-WXTG) is the problem. 

As per the usage docs at the top of the script, the servicedesk_id can be found by visiting your customer portal for the Jira Service Desk Project and looking for the number in the URL

For Example,

If your customer portal url is https://<base_url>/servicedesk/customer/portal/2

Then 2 is your servicedesk_id and you should use this to run the script

python bulk_customer_import.py "http://xxx-xxjir01:8080" "user" "password" bulk_import.txt 2

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events