Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

I am trying to get incident create into jira from servicenow to jira getting error Edited

Tharun k I'm New Here May 12, 2021

I am trying to get incident create into jira from servicenow to jira getting error

when incident record created in servicenow then record created into Jira.

error message is:{"errorMessages":["Unexpected character ('b' (code 98)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: org.apache.catalina.connector.CoyoteInputStream@210a550f; line: 1, column: 2]"]}

 

Business rule script : servicenow side 

(function executeRule(current, previous /*null when async*/) {

//var body = "{\"fields\": {\"project\":{\"key\": \"Servicenow Porject\"},\"summary\": \"This is jira demo.\",\"issuetype\": {\"name\": \"incident\"}}}";

var body="{\"fields\":{\"project\":{\"key\":\"Servicenow Porject\"},\"summary\":\"This is JIRA demo summary\",\"description\": \"Demo JIRA description\",\"issuetype\": {\"name\":\"incident\"}}}";
var request= new sn_ws.RESTMessageV2();
request.setEndpoint('https://tharun1245.atlassian.net/rest/api/3/issue');
request.setHttpMethod('POST');
request.setRequestBody('body');

var user = 'kumarservice7@gmail.com';
var password = '**************';

request.setBasicAuth(user,password);
request.setRequestHeader("Accept", "application/json");
request.setRequestHeader("Content-Type", "application/json");

var response = request.execute();
gs.log('jira status:' + response.getBody());

})(current, previous);

 

how correct this please help on this

 

Regards,

Tharun

1 answer

0 votes
Hana Kučerová Community Leader May 13, 2021

Hi @Tharun k ,

welcome to the Atlassian community!

First of all I strongly advice you to edit your post and remove the password, because this is public site and anybody can see it.

I've found this article, did you use it for inspiration?

I cannot tell you, if the concept works, because I don't work with Servicenow, but what I can see after the quick check, that project key is definitely not right, "Servicenow Porject" is probably the name of the project, not the key.

Then also this row doesn't seem right.

request.setRequestBody('body');

 It probably should be

request.setRequestBody(body);

because you want to use your variable instead of string.

Also the description param in the body doesn't seem to be in the correct format, so I would recommend you to remove it for now.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

336 views 9 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you