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": [
{
"name": "134",
"id": "144-47",
"$type": "BuildBundleElement"
},
{
"name": "136",
"id": "144-48",
"$type": "BuildBundleElement"
}
],
"$type": "MultiBuildIssueCustomField"
}
 

 

1
6 comments

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:

curl --location --request POST 'http://localhost:8087/api/issues/2-3/fields/117-6?$top=-1&fields=$type,id,value($type,archived,avatarUrl,buildIntegration,buildLink,color(background,id),description,fullName,id,isResolved,localizedName,login,markdownText,minutes,name,presentation,ringId,text)' \
--header 'Authorization: Bearer perm:cm9vdA==.NDYtMA==.9ygiNAopPW922xFBDkBnaBvoWCBpaY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "$type": "MultiBuildIssueCustomField",
    "id": "117-6",
    "value": [
        {
            "name": "DEMO-1",
            "$type": "BuildBundleElement"
        }
    ]
}'

I can't see here https://www.jetbrains.com/help/youtrack/devportal/api-entity-BuildBundleElement.html. buildLink  property


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. 

1

> 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. 

1

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. 

1

Thanks for the update.

From my point of view. It makes sense to allow to update this field using API. 

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.

0

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. 

0

Yes, there are a few read-only properties that are only available internally. This is one of them. Hence it's not documented. 

0

Please sign in to leave a comment.