• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • youtrack-plugin
    • None
    • jenkins 1.576, youtrack plugin 0.6

      While the youtrack plugin seems to be working fine generally, I do miss the option to execute a custom command from a build step. The description says "Execute commands from build steps", but I do miss the youtrack command options besides other available build step actions like "Execute a shell command".

      Are there any prerequesites for it appear? Or maybe it's not implemented although the docs suggest it? (There is no further mention of it).

          [JENKINS-24333] No action for executing command from build step

          Wolfgang Ziegler created issue -
          Wolfgang Ziegler made changes -
          Summary Original: No action for executing command from buidl step New: No action for executing command from build step
          Wolfgang Ziegler made changes -
          Environment Original: jenkins 1.576 New: jenkins 1.576, youtrack plugin 0.6

          Erik Zielke added a comment -

          Sorry, the documentation is wrong. This is not currently possible. I will update the documentation.

          Is what you want a build step where you can specify a search query and command to apply to each of the issues found by the query or is it something else? Can you perhaps describe the use case?

          The above described build step should be pretty straighforward to implement, so will try to see if I can get time to do it in the next couple of days.

          Erik Zielke added a comment - Sorry, the documentation is wrong. This is not currently possible. I will update the documentation. Is what you want a build step where you can specify a search query and command to apply to each of the issues found by the query or is it something else? Can you perhaps describe the use case? The above described build step should be pretty straighforward to implement, so will try to see if I can get time to do it in the next couple of days.

          yeah, the use case is pretty simple: I'd like to be able to post a comment to the issue which relates to my Git branch or pull request. Given a command with jenkins variable expansion it would be easy to post a useful comment, however I guess the tricky part is figuring out the issue to post the comment to. Maybe best, one could provide a string (with jenkins variable expansion) that the plugin could parse for the issue ID.

          We are using branch names for the implementation of certain tickets, e.g. feature/PR-X-something - whereas PR-X is the youtrack issue ID, thus there is no leading #. Mentioning that, from the documentation it was not clear to me that it requires the leading # for parsing ticket IDs from commit messages, so maybe that's something you could clarify in the docs also.

          Wolfgang Ziegler added a comment - yeah, the use case is pretty simple: I'd like to be able to post a comment to the issue which relates to my Git branch or pull request. Given a command with jenkins variable expansion it would be easy to post a useful comment, however I guess the tricky part is figuring out the issue to post the comment to. Maybe best, one could provide a string (with jenkins variable expansion) that the plugin could parse for the issue ID. We are using branch names for the implementation of certain tickets, e.g. feature/PR-X-something - whereas PR-X is the youtrack issue ID, thus there is no leading #. Mentioning that, from the documentation it was not clear to me that it requires the leading # for parsing ticket IDs from commit messages, so maybe that's something you could clarify in the docs also.

          >The above described build step should be pretty straighforward to implement, so will try to see if I can get time to do it in the next couple of days.

          That would be awesome, thanks!

          Wolfgang Ziegler added a comment - >The above described build step should be pretty straighforward to implement, so will try to see if I can get time to do it in the next couple of days. That would be awesome, thanks!

          Erik Zielke added a comment -

          I have uploaded a version to the experimental update center (http://jenkins-ci.org/content/experimental-plugins-update-center). Could you check to see if it feeds your needs?

          Erik Zielke added a comment - I have uploaded a version to the experimental update center ( http://jenkins-ci.org/content/experimental-plugins-update-center ). Could you check to see if it feeds your needs?

          Thanks a lot for implementing this!

          Sry, it took me a while to come back to this, but I tested it now. I used 1.6.1 as I figured it's already included in there.

          The configuration options look good to me, however I had some troubles configuring it properly for my needs. I have two problems:

          • I'd need the build changelog in a variable, such that I can add it to the comment and to "find issues ids in text". Google told me ${CHANGES} should be there, but that does not work for me. Any idea how I could access the build changelog?
          • I tried manually inserting issue ids in the "find issues ids in text" by inputting "#XYZ-123 something" in there, but it tried to send the command to "XYZ" instead of "XYZ". So looks like the issue parsing does not work properly here?

          Lastly, a minor issue, but I noted there is "and and" in the following help text:
          >Text to search for issues ids for which the command will be applied. If both search query and and issue in text is set, the command will be applied to the union of the two.

          Wolfgang Ziegler added a comment - Thanks a lot for implementing this! Sry, it took me a while to come back to this, but I tested it now. I used 1.6.1 as I figured it's already included in there. The configuration options look good to me, however I had some troubles configuring it properly for my needs. I have two problems: I'd need the build changelog in a variable, such that I can add it to the comment and to "find issues ids in text". Google told me ${CHANGES} should be there, but that does not work for me. Any idea how I could access the build changelog? I tried manually inserting issue ids in the "find issues ids in text" by inputting "#XYZ-123 something" in there, but it tried to send the command to "XYZ" instead of "XYZ". So looks like the issue parsing does not work properly here? Lastly, a minor issue, but I noted there is "and and" in the following help text: >Text to search for issues ids for which the command will be applied. If both search query and and issue in text is set, the command will be applied to the union of the two.

          Erik Zielke added a comment -

          About changelog in an environmnet variable, I had a similar need once, and as far as I can remember there is only IMHO weird ways to get it, e.g. by calling the xml/json api from the build. Maybe there is some plugin which sets that variable. Developing this plugin I have found that the Git Plugin only shows the first line or 80 chars (can't remember which) of the commit message, I get the remaining text by reflection as do the view renders. This might also be an issue when calling the api.

          Am I overlooking something or haven't you written the same project twice ("XYZ" instead of "XYZ")? I haven't have time to test it my self yet.

          Thanks for mentioning the typo.

          Erik Zielke added a comment - About changelog in an environmnet variable, I had a similar need once, and as far as I can remember there is only IMHO weird ways to get it, e.g. by calling the xml/json api from the build. Maybe there is some plugin which sets that variable. Developing this plugin I have found that the Git Plugin only shows the first line or 80 chars (can't remember which) of the commit message, I get the remaining text by reflection as do the view renders. This might also be an issue when calling the api. Am I overlooking something or haven't you written the same project twice ("XYZ" instead of "XYZ")? I haven't have time to test it my self yet. Thanks for mentioning the typo.

          Sry, it should have been '"XYZ" instead of "XYZ-123"' - the number and the dash is missing from the detected issue ID.

          Without a changelog variable, I've no idea how I'd get to the right youtrack issue for posting a comment to - so it looks like I'll have to figure this one out. Thanks for the tip with the API - http://stackoverflow.com/questions/11823826/get-access-to-build-changelog-in-jenkins describes this also.

          Basically it's about having a custom comment message (where I can make use of environment variables) instead of "Update YouTrack issue with link to build". Thus, appending information to the default comment posted to the issue would be already helpful as well. Does it post "build notes" maybe, or is the posted text hard-coded right now?

          Thanks a lot!

          Wolfgang Ziegler added a comment - Sry, it should have been '"XYZ" instead of "XYZ-123"' - the number and the dash is missing from the detected issue ID. Without a changelog variable, I've no idea how I'd get to the right youtrack issue for posting a comment to - so it looks like I'll have to figure this one out. Thanks for the tip with the API - http://stackoverflow.com/questions/11823826/get-access-to-build-changelog-in-jenkins describes this also. Basically it's about having a custom comment message (where I can make use of environment variables) instead of "Update YouTrack issue with link to build". Thus, appending information to the default comment posted to the issue would be already helpful as well. Does it post "build notes" maybe, or is the posted text hard-coded right now? Thanks a lot!

            erikzielke Erik Zielke
            fago Wolfgang Ziegler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: