Skip to main content

How to update job config files using the REST API and Java?

Comments

5 comments

  • Anant Patil

    Hi,

    I have used the above code and update my config file of specific job but its not replicating the changed config file in under that job?Please let me know is the above code working fine?Thanks

    0
  • Denys Digtiar

    Hi Anant,

    Not sure what you mean by "... but its not replicating the changed config file in under that job". 

    The code should have been tested at the moment of writing. Given the backward compatibility of Java, it should still work as it was.

    0
  • Anant Patil

    Hi Denys,

    Thank you for reply,

    Please consider this scenario,I have declared Global string parameter(GIT_PATH) for the job 'ABC',I am trying to update the value of GIT_PATH through the above code but its not reflecting that changes in server job 'ABC' config file.

     

    0
  • Anant Patil

    Hi Denys,

    I have got it ,Thank you.

    0
  • Anil Shekhar

    Hi Denys,

    I keep getting java.io.FileNotFoundException at InputStream inputStream = connection.getInputStream(). I am not sure why and how to go about this exception. I do have the valid URL for the job config.xml and am using usename and API token. 

    I even tried giving the following as I need to access the config.xml of a CI job.

    connection.setRequestMethod("GET");

    Still there is exception

    Thanks in advance for your help

    Anil

     

    0

Please sign in to leave a comment.

About CloudBees Support

Our Support Engineers are available to help with any questions or problems you may have with any of our products.