Creazione di utenti senza password tramite API

I am migrating my support forum to Discourse from a helpdesk (YouTrack).
I would like to use API to do the following:

  1. Pull users (name, username, e-mail) from YouTrack and create similar users in Discourse. Not setting passwords for them!
  2. Send an invitation to all these users to sign up in Discourse, using the same usernames and e-mails (for them to create new passwords).
  3. Pull certain topics, attachments, and comments from YouTrack and create the same in Discourse.
    For that, I will need the same users to exist in Discourse so that they could be made authors of topics and comments. This has to be done, no matter whether such users have signed up in Discourse after receiving the invitation, or not.

Problems:
a) The API documentation says that the “password” field is required when creating a user. How can I work around it?
b) What should be the state of such user (created via API, already has some topics under his name, but not yet confirmed, nor password set)?

1 Mi Piace

I would create the users, categories, topics, and posts using an import script rather than the API.

I’m not quite sure how best to email every single user, but one way would be to have the import script leave users activated and allow them to get a summary message emailed to them and see that the summary email includes instructions for accessing the new forum.

2 Mi Piace

What would such script work with? Directly with the database?

Have a look at the import scripts in scripts/import.

1 Mi Piace

I tried to use this script of yours, that seems to be doing the trick, but keep getting an error message:

 ./create-user 'Test User Four' me@[domain] test4 41 default
Creating user: test4 user test4 created. .  . Adding to group 41. . . {"errors":["You supplied invalid parameters to the request: usernames"],"error_type":"invalid_parameters"}

Can’t figure out, what have I done wrong. Also, is it possible not to set group and password here?

I mostly don’t know, but it seems like you have a bogus group number and you’re getting an error? If it’s adding the user then it would seem that it’s not setting a group already. :wink:

You could change the script to have it not set a password, I think, but setting a random password that no one knows is pretty much the same thing as no password.

If you need customization and have a budget, I can probably do it later today.

The group number is correct, I took it from /groups.json. Anyway, my current goal is to find out the solution with whatever tools are available. Thank you for your offer and help though!

1 Mi Piace

Hmm. Maybe that api changed. I think that it’ll now take a group name. You’re welcome to submit a PR if you come up with something.

I’ve got a bunch of stuff on my list before I can have a closer look at this.

No. If I use the group name instead of the ID, I get
{"status":404,"error":"Not Found"}

It’s also strange, that although the error message appears after user test6 created. . . Adding to group, the user is actually not created.

Hmm. Well, the script definitely needs to be updated to send the API user and key in a header rather than in the URL. While I’m pretty sure that it worked two years ago, it looks like it was written by someone with two years less experience than I have now. :wink:

It doesn’t do any error checking to see if the user actually gets created, so that’s something that I’d change if I were to work on it.

It looks like if you don’t have any groups it’ll skip trying to add the user to the group.

1 Mi Piace

Ciao Dmitry @dm.linov!

Ho trovato questo argomento cercando approcci per spostarsi tra Confluence, Youtrack e Discourse.

Potresti condividere i tuoi punti principali riguardo al passaggio da Youtrack a Discourse? La ragione è stata il costo, le prestazioni o problemi di ricerca?

Ciao Ivan,

Entrambe le ragioni sono vere. Volevamo offrire supporto ai nostri clienti su un forum pubblico, in modo che tutto il mondo potesse vedere quanto siamo bravi :slight_smile: E YouTrack non era uno strumento adatto per questo per diversi motivi, tra cui il fatto che addebita una tariffa per utente.

La nostra configurazione attuale è la seguente:

  • Discourse per il supporto, le richieste di funzionalitĂ  e le discussioni. Anche i moduli “Contattaci” sui nostri siti web confluiscono lì (nuovi argomenti e utenti “in fase di staging” vengono creati automaticamente tramite API)
  • YouTrack per lo sviluppo: attivitĂ , bug e altri problemi
  • Confluence per la documentazione generale. Alcuni articoli che descrivono casi d’uso specifici vengono pubblicati anche su Discourse (manualmente)

Abbiamo anche provato a utilizzare Discourse come blog aziendale, ma in seguito abbiamo preferito Hashnode.

3 Mi Piace

Grazie, Dmitry. Questa esperienza sarĂ  utile per noi.

Stiamo per spostare la documentazione da Confluence. Ha una funzione di ricerca debole e costi elevati. Youtrack dispone di una funzione Knowledge Base con supporto per Markdown. Inoltre, offre un’importazione semplice e una funzione di ricerca accettabile. Youtrack è il nostro sistema di tracciamento dei bug e lo manterremo.

Se puoi confermare che la Knowledge Base di YT è lenta in produzione, potremmo valutare di non utilizzarla.

Discourse viene utilizzato come sistema di supporto di terzo livello. La funzione principale è salvare le soluzioni dei clienti e condividere le migliori pratiche. Purtroppo, l’utilizzo di Discourse da parte dei clienti è difficile. Il team di assistenza clienti utilizza infatti un Service Desk. Inoltre, è troppo complicato creare centinaia di categorie private per ogni cliente.

Comunque, Discourse è ottimo in generale :slight_smile:.

1 Mi Piace

Per quanto ne so, non abbiamo mai utilizzato la Knowledge base di YT, quindi non posso dire nulla a riguardo.

Per quanto riguarda Confluence, stiamo anche cercando un’alternativa ora :slight_smile: ma senza fretta.

3 Mi Piace

Hai dato un’occhiata a Discourse for teams?

3 Mi Piace

@blake Non ancora, lo guarderò, grazie!

1 Mi Piace

Potrebbe valere la pena considerare l’uso di Discourse for Teams in combinazione con Google Currents. :speech_balloon:

2 Mi Piace