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

How to set Request Language for requests created with the REST api

Ellie Bellemans September 10, 2021

As far as I understand, Request Language is a (locked) custom field. I can see all custom fields for a request type with  

GET /servicedeskapi/servicedesk/2/requesttype/{requestTypeId}/field

but Request Language isn't one of them. 

I understand that since the request is submitted on behalf of a user (in this case the user to whom the api key belongs) and as such, the Request Language should be a field on the request form so it shows in the list of custom fields (correct?) but when I try to add it to the form I get the following warning 

image.png

Is there a way to provide a preset value? And is this the correct approach?

Another option would probably be to change the default language of the user to whom the api key belongs (haven't tried it yet so not sure if this is correct) but since we forward requests from our app through our backend, it would be nice if we can inherit the user's app language when creating the ticket.

So what is the advised way to set the request language using the REST api?

 

Many thanks

1 answer

0 votes
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 14, 2021

Hello @Ellie Bellemans,

Thanks for reaching out to Atlassian Community!

The Request language field is automatically filled based on the browser’s language or the one the customer selects in their profile on the customer portal. 

8.png 

That’s why when adding the field to the request form, it will be hidden and it’s not possible to set a default value because there is already a default one, which is the default language of the project (Project settings > Language support).

With this said, it will also not be possible to set the value using API when creating tickets on behalf of the customer.

There was a feature request suggesting this ability, but it was closed as “Won’t fix” since there was only one vote since it was created:

I added an internal comment with the link to this question on the ticket above and since it’s not possible to vote, feel free to add a comment and watch to receive updates.

Currently, there is no workaround for that since the field is also not supported on Automation.

Kind regards,
Angélica

Ellie Bellemans September 20, 2021

Hi @Angélica Luz 

This all makes sense but if I understand correctly, all new requests that are created through the api should either

  • inherit the default language of the project (see first screenshot)
  • inherit the language of the user to whom the api key belongs to (see second screenshot)

project default:

image.png

"api key user" default:

image.png

Because of this, when our users (all dutch) send requests through our app (and thus api), they will receive a confirmation mail with English links etc. 

Is there any way to fix this? Is there a workaround? Or are all requests created through the api by default in English, regardless of any setting? Or is this a bug? :) 

Many thanks for your help!

Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 21, 2021

Thank you for the details, Ellie.

I tested here by changing all settings to Portuguese (my profile, the project default language, the site indexing, and the default language), but all tickets created via API are set to English.

Also, I tested creating a ticket with a customer account via API, but it also sets the request language as English, but the notification was correctly using the project default one.

Based on that, I created a bug:

We are working on a workaround to change the request language via automation that will also use API. Once we have all the steps, I will share them on the bug ticket and here with you as well.

Ellie Bellemans September 21, 2021

Wonderful, I'll keep an eye on it :) 

Thank you so much for your help Angélica! 

Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 22, 2021

Hi Ellie,

One of our developers checked the bug and added an internal comment informing us that the request language is based on the content of the request and not the default language of the project or the requester language and I tested here and confirmed the behavior.

On my test project I added English (the default language), Portuguese and Spanish.

Then, in order to test, I created tickets via API with the summary and description in Portuguese and the request language was correctly set as Portuguese and the same for Spanish.

After that, I tested creating a ticket in German that is a language not available on my project, then the request language was set to English.

The same happens if I create a ticket with a summary and description with words in Portuguese, but also some words in English. Since there is a mix of words in different languages, the request language was set to English.

Regarding the notifications, I created this mind map for a better understanding:

Screen Shot 2021-09-22 at 11.43.18.png

Summarizing:

  • The request language will be set based on the content of the request and if the language is available on the project.
  • The notifications will be based on the customer profile and if the language is available on the project.

Honestly, I wasn’t aware of this behavior, that’s why I created the bug, which actually is not a bug.

I’m checking with the developers to see if there is any public documentation about that because we haven’t found any.

Please, let me know if you have any other questions.

Like # people like this
Ellie Bellemans September 28, 2021

Oh waauw, so there was magic under the hood? :) 

Just tested, works like a charm! But it would be helpful indeed if it was documented somewhere ;)

Thanks for looking into this @Angélica Luz You're the best! 

Like Angélica Luz likes this
Angélica Luz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 12, 2021

Hello @Ellie Bellemans,

Hope you are doing well!

I know it has been a while, but I want to share that I posted an article today with all the details about the Request language field.

By testing all the possibilities, the language is set based on the content not only via API, but also via the portal, email, widget and the create button in Jira.

Your question was the inspiration for this article, so thank you very much :D

Hope you have a great weekend!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events