Push a value into a customField in jira with Node JS


var request = require('request');

var options = {
   method: 'GET',
   url: 'https://actility.atlassian.net/rest/api/2/issue/SCII-1',
   headers: {
      'Accept': 'application/json',
      'Authorization': 'Basic <****>'
request(options, function (error, response,issue) {
   if (error) throw new Error(error);
      'Response: ' + response.statusCode + ' ' + response.statusMessage
   var json = JSON.parse(issue);
    //********* Priority Algorithm (var score1) ******** */
    //********* Actility Expected Value Algorithm (var score2) ******** */
    //********* Customer CR Algorithm (var score3)******** */
    //********* Effort Estimate Algorithm (var score4) ******** */
    //********* PM Weight Algorithm (var score5) ******** */   
    //********* Computed Score Card ******** */ 
    var score6 = +80;

   // OUTPUT
   var total = score1+score2+score3+score4+score5+score6;   //!\ How can I push this value into the customfield_14038
   console.log("total: "+total)


In my script, i have a variable (var total) with a value and I want to push this value into a customField.
I’m using Node JS.

Thank you in advance for your help

Best regards,

Hello @anon22528121,

If I understood your question correctly, you want to put the computed value to the issue’s custom field. The Edit issue REST API might be able to help you out there. You’ve already done a successful REST API call when you did GET so do a PUT and pass the request body with the computed total, something like this

  "fields": {
    "customfield_14038": <theComputedTotal>


Understand, Thank you

Hi ,
var Summary = "Create Ticket "

“fields”: { “summary”: “Summary” }
I need to send my Summary in this field .
can you please help me with the format.

Thanks in Advance ,