Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Issue with build request via API #4684

hung ·

Hello Mr. Robin Shen and Mr. Steve Luo,

We are encountering an issue when a user requests a build via the API. The XML file contains variables that the user does not have permission to modify.
Do you have any suggestions for handling this situation?

Thank you.

  • replies 7
  • views 134
  • stars 0
robinshen ADMIN ·

Do you mean that restful api is able to specify variable values but the variables are not set to prompted from web UI?

hung ·

User used /rest/builds/build_id to get build variables then use the result to submit a build request via the API
Consequently, they can modify not prompted variables in api request.
To address this, we propose adding a configuration option in general setting or a similar option in another page to define which variables are accessible via GET requests and suitable in POST requests.

robinshen ADMIN ·
hung ·

Hello Mr. Robin Shen,

when 'Check API Build Request Variables' checked yes, user can not request build via api only use promotionSource-buildId
eachPromotion.getConfigurationPath() function did not execute groovy script in {promotionSource > promotion > Configuration}

Please help me check it.
Thank you

robinshen ADMIN ·

Not quite understand the issue here. Can you please show me an example?

hung ·

Example:
I have 2 configurations: root/SRC & root/DES
I used api to create build request in configuration "root/DES"

<com.pmease.quickbuild.BuildRequest>
{root/DES configuration id}

{build in root/SRC}

</com.pmease.quickbuild.BuildRequest>

DES - Check API Build Request Variables: A
SRC - Promotions> Promotion_1:
Configuration: ${groovy: return "root/DES"}

If A=="no", build request created successfully by api
If A=="yes", can not create build request:
error: 500
msg: Unable to find promotion targetting configuration 'root/DES'

robinshen ADMIN ·