Update Build Id with the jenkins build id and url
Hello.
I'm trying to update "Build Id" field in the issue.
First of all I'm trying to add BuildBundleElement into the Build Id custom field.
Currently my issue have such Custom field
/api/issues/BACKW-58?fields=customFields(id,name,value(avatarUrl,buildLink,color(id),fullName,id,isResolved,localizedName,login,minutes,name,presentation,text))
{
"value": [
{
"buildLink": "https://jenkins.url.com/job/bbbb/134",
"name": "134",
"id": "144-47",
"$type": "BuildBundleElement"
},
{
"buildLink": "https://jenkins.url.com/job/bbbb/136",
"name": "136",
"id": "144-48",
"$type": "BuildBundleElement"
}
],
"$type": "MultiBuildIssueCustomField"
}
I can't see here https://www.jetbrains.com/help/youtrack/devportal/api-entity-BuildBundleElement.html. buildLink property.
Please sign in to leave a comment.
Hi!
I'm Sergey from the YouTrack team.
If you want to update a value of a specific field, then you can just send a request for this field only: POST api/issues/2-3/fields/117-6. 2-3 — issue ID, 117-6 — field ID. Here's the example of the request:
The buildLink is generated automatically from the value and connected Jenkinks project. So there's no point in exposing this property since that you can't adjust it manually.
If any questions appear, please let me know.
> The buildLink is generated automatically from the value and connected Jenkinks project.
In this case we need to setup jenkins - youtrack integration. But we have our own flow - we need to update issue in the project but neither branch name nor git commit don't have any mentions about Youtrack issue id (We want to update "Fixed in build" field in the parent task, so git branch is different from the issue id and we don't want to force developers to put parent task id to the git commit message).
Currently we use API to create BuildBundleElement, then put it into the field (Fixed in build), and then update values in the issue. Everything is ok except we can't specify "Build link", that's why need to open jenkins and find job build manually.
From my point of view. It makes sense to allow to update this field using API.
I can for example print Task ID which I need to update to jenkins console log, but as we discussed here (https://youtrack-support.jetbrains.com/hc/en-us/community/posts/7191487137298-jenkins-integration-reference-to-issue-id) your integration doesn't read it.
Thanks for the update.
Unfortunately, there's no way to enable it, so you have to work around it. You'll have to post this link elsewhere: a separate field (e.g., string or text), description, comment section, and so on.
Strange, you have an API, you have field (Simple string field) which you use in your integration but you don't allow your customers to do the same.
Ok. Thank you.
Yes, there are a few read-only properties that are only available internally. This is one of them. Hence it's not documented.