Hello Team,
I am working on integrating Freshservice with Jira Service Management (JSM) and facing an issue with syncing the priority field. In JSM, I have set up an automation rule as follows:
Event: When an issue is created, an action is triggered to use a lookup table, where the keys are "Urgent," "High," "Medium," and "Low," corresponding to numeric values 4, 3, 2, and 1, respectively.
Action: The next step is a web request to create a ticket in Freshservice. In the custom data for the web request, I am trying to pass the priority value using this syntax:
"priority": "{{priorities.get(issue.priority.name)}}"
However, when I validate the web request, I am receiving the following error for the priority field:
"field": "priority", "message": "It should be one of these values: '1, 2, 3, 4'", "code": "invalid_value"
It seems like the value passed for the priority field isn't matching the expected values (1, 2, 3, 4). Could anyone assist me in resolving this error and ensure that the priority value is properly passed to Freshservice?
Thank you in advance for your help.
Hi and welcome to the community!
If I understand your question correctly, this one should be posted in the Freshdesk community since you are getting the error from their API.
Jeroen
Hi Jeroen,
Thanks for your response! It’s possible that this could be an error, so I’ve raised it with the Freshservice community for further investigation.
However, I’ve noticed that the value being generated from the syntax is being treated as text, even though I’m trying to pass a numeric value. The issue is that when I manually set a value like 2
, it works perfectly fine. So, I suspect that the problem lies with how the value is being generated from the syntax.
Can you please guide me on how I can modify the syntax to ensure that it generates a numeric value instead of a text string? Any advice on how to pass the value as a number would be greatly appreciated.
Thanks again for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you try:
"priority": "{{priorities.get(issue.priority.name).asNumber}}"
Jeroen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I assume you are doing a webrequest from an automation rule? If so, would tou mind sharing the body of your request?
Also try omitting the quotes :-)
"priority": {{priorities.get(issue.priority.name).asNumber}}
Jeroen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Correct, I am making a web request and have tried omitting the quotes, but I am still facing the same issue. Below is the body of the request.
{
"subject": "{{issue.summary}}",
"description": "{{issue.description}}",
"category": "{{issue.customfield_10476}}",
"sub_category": "{{issue.Request_Type.requestType.name}}",
"department_id": 55000429234,
"priority": "{{priorities.get(issue.priority.name).asNumber}}"
"status": 2,
"source": 3,
"custom_fields": {
"raised_by": "CF Test 1",
"raised_by_analyst": "Store",
"jira_id": "{{issue.key}}"
},
"email": "{{issue.reporter.emailAddress}}"
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I still see this line:
"priority": "{{priorities.get(issue.priority.name).asNumber}}"
Replace is by:
"priority": {{priorities.get(issue.priority.name).asNumber}}
Without quoting the numeric value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On first one: error which i have faced is value should 1,2,3, and 4.
and On second one: Invalid Json
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, then the last thing to check on Atlassian side is whether the expressions returns what you think it does. Put in a Log action and write both values to the log (first and second) and validate if it is correct (you can find the log in the audit log of the rule).
Jeroen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Value: "{{priorities.get(issue.priority.name).asNumber}}"
Issue created
01/10/2025, 15:18:41
Create lookup table
01/10/2025, 15:18:42
Send web request
01/10/2025, 15:18:42
Unable to publish the web request - received HTTP status response:
400
Error found in the HTTP body response:
{"description":"Validation failed","errors":[{"field":"priority","message":"It should be one of these values: '1,2,3,4'","code":"invalid_value"}]}
Log action
01/10/2025, 15:18:42
Log
"priority": ""
Value : {{priorities.get(issue.priority.name).asNumber}}
Issue created
01/10/2025, 15:20:50
Create lookup table
01/10/2025, 15:20:51
Send web request
01/10/2025, 15:20:51
Unable to publish the web request - received HTTP status response:
400
Error found in the HTTP body response:
{"code":"invalid_json","message":"Request body has invalid json format"}
Log action
01/10/2025, 15:20:51
Log
"priority":
Value: "{{priorities.get(issue.priority.name)}}"
Issue created
01/10/2025, 15:22:08
Create lookup table
01/10/2025, 15:22:09
Send web request
01/10/2025, 15:22:09
Unable to publish the web request - received HTTP status response:
400
Error found in the HTTP body response:
{"description":"Validation failed","errors":[{"field":"priority","message":"It should be one of these values: '1,2,3,4'","code":"invalid_value"}]}
Log action
01/10/2025, 15:22:09
Log
"priority": ""
Value: {{priorities.get(issue.priority.name)}}
Issue created
01/10/2025, 15:25:12
Create lookup table
01/10/2025, 15:25:13
Send web request
01/10/2025, 15:25:13
Unable to publish the web request - received HTTP status response:
400
Error found in the HTTP body response:
{"code":"invalid_json","message":"Request body has invalid json format"}
Log action
01/10/2025, 15:25:13
Log
"priority":
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jeroen, i have try four value and attached their logs.
Can you please check and let me know if i have done correctly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It looks like your lookup isn't working, there is no value logged to the rule audit log.
Check issue.priority.name in the same way, check every step where you expect a value via the log action until you find where something does not have a value where it should have.
Jeroen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also, i have try direct smart value in JSM
Value: "priority": "{{issue.priority}}"
Issue created
01/10/2025, 15:29:02
Create lookup table
01/10/2025, 15:29:03
Send web request
01/10/2025, 15:29:03
Unable to publish the web request - received HTTP status response:
400
Error found in the HTTP body response:
{"description":"Validation failed","errors":[{"field":"priority","message":"The value provided is of type String.It should be one of these values: '1,2,3,4'","code":"datatype_mismatch"}]}
Log action
01/10/2025, 15:29:03
Log
"priority": "3"
As you can see the value generating is as string
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Value: "priority": "{{issue.priority.name}}"
Issue created
01/10/2025, 16:27:19
Create lookup table
01/10/2025, 16:27:20
Send web request
01/10/2025, 16:27:20
Unable to publish the web request - received HTTP status response:
400
Error found in the HTTP body response:
{"description":"Validation failed","errors":[{"field":"priority","message":"It should be one of these values: '1,2,3,4'","code":"invalid_value"}]}
Log action
01/10/2025, 16:27:20
Log
"priority": "2 High"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There you go, it returns "2 High" instead of "High". Your lookup table should reflect that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Value: "{{priorities.get(issue.priority.name)}}"
Issue created
01/10/2025, 16:35:47
Create lookup table
01/10/2025, 16:35:48
Send web request
01/10/2025, 16:35:48
Unable to publish the web request - received HTTP status response:
400
Error found in the HTTP body response:
{"description":"Validation failed","errors":[{"field":"priority","message":"The value provided is of type String.It should be one of these values: '1,2,3,4'","code":"datatype_mismatch"}]}
Log action
01/10/2025, 16:35:48
Log
"priority": "3"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried this without quotation marks, and this time it worked. Thank you so much for your help. I really appreciate it!"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, good!
Kindly accept the answer so it is marked resolved.
Jeroen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.