Skip to content

[JENKINS-31831] Allow Workflow Snippet Generator to be used outside of a configuration page #354

Description

@jenkins-infra-bot

A user should have a way of accessing the Workflow Snippet Generator without having to create a job. At least, it would be useful to be able to link to a functional Workflow Snippet Generator. Since the available snippets may vary depending on the plugins installed, this is something that needs an active Jenkins instance. Perhaps the scripts could be stored in a shared location that could later be accessed by jobs.


Originally reported by kzantow, imported from: Allow Workflow Snippet Generator to be used outside of a configuration page
  • assignee: jglick
  • status: Resolved
  • priority: Minor
  • component(s): pipeline
  • label(s): ux
  • resolution: Fixed
  • resolved: 2016-05-23T19:42:54+00:00
  • votes: 1
  • watchers: 10
  • imported: 2025-12-08
Raw content of original issue

A user should have a way of accessing the Workflow Snippet Generator without having to create a job. At least, it would be useful to be able to link to a functional Workflow Snippet Generator. Since the available snippets may vary depending on the plugins installed, this is something that needs an active Jenkins instance. Perhaps the scripts could be stored in a shared location that could later be accessed by jobs.

Activity

  1. jenkins-infra-bot commented on Dec 1, 2015

    @jenkins-infra-bot
    Author
    • Remote link associated with this issue:

  2. jenkins-infra-bot commented on Dec 1, 2015

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      I do not think it is unreasonable to ask the user to create something Workflow-related to get a GUI link to the page where the tool may be found, but it need not be configure of a WorkflowJob; could also offer it from the configuration screens of multibranch workflows and organization folders using the Jenkinsfile recognizer.

      I would propose just having a top-level page, with a link exposed in various places that opens it in another browser tab, rather than displaying inline in the job configuration screen as is done today. (CJE users also get it in Workflow template transformers.)

    I do not think it is unreasonable to ask the user to create something Workflow-related to get a GUI link to the page where the tool may be found, but it need not be configure of a WorkflowJob; could also offer it from the configuration screens of multibranch workflows and organization folders using the Jenkinsfile recognizer.

    I would propose just having a top-level page, with a link exposed in various places that opens it in another browser tab, rather than displaying inline in the job configuration screen as is done today. (CJE users also get it in Workflow template transformers.)

  3. jenkins-infra-bot commented on May 20, 2016

    @jenkins-infra-bot
    Author
    hrmpw:
    • Original comment link
    • Raw content of original comment:

      Would this also include links to the DSL Reference and .gdsl file? jglick

    Would this also include links to the DSL Reference and .gdsl file? jglick

  4. jenkins-infra-bot commented on May 20, 2016

    @jenkins-infra-bot
    Author
    jglick:
    • Original comment link
    • Raw content of original comment:

      hrmpw yes this keeps all that functionality in one place.

    hrmpw yes this keeps all that functionality in one place.

  5. jenkins-infra-bot commented on May 23, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Jesse Glick Path: src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition.java src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition.java src/main/java/org/jenkinsci/plugins/workflow/cps/Snippetizer.java src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/help-script.html src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/SidepanelAction/action.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/block.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslHelp.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReference.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReferenceContent.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/help.html src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/html.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/index.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/sidepanel.jelly src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/f3958997d201d39a952c6572eb623a8730b822d7 Log: JENKINS-31831 Make Snippetizer UI be displayed in a top-level page.

    Code changed in jenkins
    User: Jesse Glick
    Path:
    src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition.java
    src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition.java
    src/main/java/org/jenkinsci/plugins/workflow/cps/Snippetizer.java
    src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly
    src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/help-script.html
    src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/SidepanelAction/action.jelly
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/block.jelly
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslHelp.groovy
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReference.groovy
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReferenceContent.groovy
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/help.html
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/html.groovy
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/index.jelly
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/sidepanel.jelly
    src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java
    http://jenkins-ci.org/commit/workflow-cps-plugin/f3958997d201d39a952c6572eb623a8730b822d7
    Log:
    JENKINS-31831">JENKINS-31831 Make Snippetizer UI be displayed in a top-level page.

  6. jenkins-infra-bot commented on May 23, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Jesse Glick
    Path:
    src/main/java/org/jenkinsci/plugins/workflow/cps/Snippetizer.java
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/SidepanelAction/action.jelly
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/sidepanel.jelly
    http://jenkins-ci.org/commit/workflow-cps-plugin/d08694dba1b3317298f9879aa67f8228f6120495
    Log:
    JENKINS-31831">JENKINS-31831 Rendering content from PerJobAction so we get the correct ancestors in our path.

  7. jenkins-infra-bot commented on May 23, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition.java src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition.java src/main/java/org/jenkinsci/plugins/workflow/cps/Snippetizer.java src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/help-script.html src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/block.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslHelp.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReference.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReferenceContent.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/help.html src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/help.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/html.groovy src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/index.jelly src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/sidepanel.jelly src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/55f8ca739f1941215af95db585682b7cdb3dd236 Log: Merge pull request #12 from jglick/Snippetizer-JENKINS-31831

      [FIXED JENKINS-31831] Make Snippetizer UI be displayed in a top-level page

      Compare: jenkinsci/workflow-cps-plugin@891a1bd...55f8ca7

    Code changed in jenkins
    User: Jesse Glick
    Path:
    pom.xml
    src/main/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition.java
    src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition.java
    src/main/java/org/jenkinsci/plugins/workflow/cps/Snippetizer.java
    src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly
    src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/help-script.html
    src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/block.jelly
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslHelp.groovy
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReference.groovy
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/dslReferenceContent.groovy
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/help.html
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/help.jelly
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/html.groovy
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/index.jelly
    src/main/resources/org/jenkinsci/plugins/workflow/cps/Snippetizer/sidepanel.jelly
    src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java
    http://jenkins-ci.org/commit/workflow-cps-plugin/55f8ca739f1941215af95db585682b7cdb3dd236
    Log:
    Merge pull request #12 from jglick/Snippetizer-JENKINS-31831">JENKINS-31831

    [FIXED JENKINS-31831] Make Snippetizer UI be displayed in a top-level page

    Compare: jenkinsci/workflow-cps-plugin@891a1bd...55f8ca7

  8. jenkins-infra-bot commented on May 23, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinder.java src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProject.java src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectFactory.java src/main/resources/org/jenkinsci/plugins/workflow/multibranch/SCMBinder/config.jelly http://jenkins-ci.org/commit/workflow-multibranch-plugin/6dd84f615efda6ccf826f328e553d16ccf4d260f Log: JENKINS-31831 Show Pipeline Groovy link on Pipeline multibranch projects and organization folders.

    Code changed in jenkins
    User: Jesse Glick
    Path:
    pom.xml
    src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinder.java
    src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProject.java
    src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectFactory.java
    src/main/resources/org/jenkinsci/plugins/workflow/multibranch/SCMBinder/config.jelly
    http://jenkins-ci.org/commit/workflow-multibranch-plugin/6dd84f615efda6ccf826f328e553d16ccf4d260f
    Log:
    JENKINS-31831">JENKINS-31831 Show Pipeline Groovy link on Pipeline multibranch projects and organization folders.

  9. jenkins-infra-bot commented on May 23, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Jesse Glick
    Path:
    pom.xml
    src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinder.java
    src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProject.java
    src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowMultiBranchProjectFactory.java
    src/main/resources/org/jenkinsci/plugins/workflow/multibranch/SCMBinder/config.jelly
    http://jenkins-ci.org/commit/workflow-multibranch-plugin/4524135f0a935f454eaffb3374b7b7d7d19d2674
    Log:
    Merge pull request #9 from jglick/Snippetizer-JENKINS-31831">JENKINS-31831

    JENKINS-31831">JENKINS-31831 Show Pipeline Groovy link on multibranch projects

    Compare: jenkinsci/workflow-multibranch-plugin@651b566...4524135

  10. jenkins-infra-bot commented on May 24, 2016

    @jenkins-infra-bot
    Author
    squalou:
    • Original comment link
    • Raw content of original comment:

      Guys, seriously, now when actually writing a job, we can't access the snippet generator in the same place ? and this is supposed ti be better ?

      Come on, switching tab/windows for copy / paste, are you kidding ?

      now, to access it, I need to have a pipeline job all the same (go wonder why), but I can't properly use it when editing the job. Well done. (sorry but I'm a bit furious here).

      I have 2 usecases to expose you :

      • : edit scripts inside the job. Then, the snippet generator as before was just perfect. Now it's a pain to use.
      • : edit a .groovy file stored on a scm, outside jenkins. For this, a snippet generator outside any job would be helpful. It's slightly better now (no need to edit an actual job), but still requires a job to exist (which is not the case when you build your jobs from DSL for instance)

      I hesitate to reopen this one / open another ticket, because I can't see any situation for which it's better now than it was.

    Guys, seriously, now when actually writing a job, we can't access the snippet generator in the same place ?
    and this is supposed ti be better ?

    Come on, switching tab/windows for copy / paste, are you kidding ?

    now, to access it, I need to have a pipeline job all the same (go wonder why), but I can't properly use it when editing the job. Well done.
    (sorry but I'm a bit furious here).

    I have 2 usecases to expose you :

    • : edit scripts inside the job. Then, the snippet generator as before was just perfect. Now it's a pain to use.
    • : edit a .groovy file stored on a scm, outside jenkins. For this, a snippet generator outside any job would be helpful. It's slightly better now (no need to edit an actual job), but still requires a job to exist (which is not the case when you build your jobs from DSL for instance)

    I hesitate to reopen this one / open another ticket, because I can't see any situation for which it's better now than it was.

  11. jenkins-infra-bot commented on May 24, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Jesse Glick
    Path:
    src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly
    src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly
    http://jenkins-ci.org/commit/workflow-cps-plugin/c8319cede23d31fc09e467f7b22e7836b273634f
    Log:
    JENKINS-31831">JENKINS-31831 Amendment to display a link in the config form, since Jenkins 2 suppresses the sidepanel on configure.

  12. jenkins-infra-bot commented on May 24, 2016

    @jenkins-infra-bot
    Author
    scm_issue_link:

    Code changed in jenkins
    User: Jesse Glick
    Path:
    src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition/config.jelly
    src/main/resources/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition/config.jelly
    http://jenkins-ci.org/commit/workflow-cps-plugin/bf459ff0487f86d2e581e2ac15ee6bca5a2c9637
    Log:
    Merge pull request #13 from jglick/Snippetizer-link-JENKINS-31831">JENKINS-31831

    JENKINS-31831">JENKINS-31831 Amendment to display a link in the config form

    Compare: jenkinsci/workflow-cps-plugin@7d9e3b2...bf459ff

  13. jenkins-infra-bot commented on May 24, 2016

    @jenkins-infra-bot
    Author
    perilousapricot:
    • Original comment link
    • Raw content of original comment:

      I hit the same issue as squalou. It's nice to have the snippet generator outside of a configuration page, but having it next to the actual configuration box was much more convenient to use. Is there any reason it can't be at both locations?

    I hit the same issue as squalou. It's nice to have the snippet generator outside of a configuration page, but having it next to the actual configuration box was much more convenient to use. Is there any reason it can't be at both locations?

  14. jenkins-infra-bot commented on May 25, 2016

    @jenkins-infra-bot
    Author
    gregcovertsmith:
    • Original comment link
    • Raw content of original comment:

      Could someone associated with this bug give the new url path to get to the snippet generator? Or path through the front page UI to get there?

      With this change in, I can't seem to find the snippet generator anywhere – now that its been removed from the new job page, should it be somewhere else now?

    Could someone associated with this bug give the new url path to get to the snippet generator? Or path through the front page UI to get there?

    With this change in, I can't seem to find the snippet generator anywhere – now that its been removed from the new job page, should it be somewhere else now?

  15. jenkins-infra-bot commented on May 26, 2016

    @jenkins-infra-bot
    Author
    mkobit:

    gregcovertsmith It looks like you go to `/pipeline-syntax` - that is the only place I found it. `http://jenkins/job/job-name/pipeline-syntax`

  16. jenkins-infra-bot commented on May 27, 2016

    @jenkins-infra-bot
    Author
    squalou:
    • Original comment link
    • Raw content of original comment:

      gregcovertsmith : other path to access it, from a 'pipeline job', there's a new item on the 'menu' on the top left (under new item, people,build history etc.) called 'Pipeline Syntax'.

    gregcovertsmith : other path to access it, from a 'pipeline job', there's a new item on the 'menu' on the top left (under new item, people,build history etc.) called 'Pipeline Syntax'.

  17. jenkins-infra-bot commented on Jun 17, 2016

    @jenkins-infra-bot
    Author
    gregcovertsmith:
    • Original comment link
    • Raw content of original comment:

      Thanks guys - I was able to find the new link.

      I did open a new related bug to this one, as the links are only shown to users who have permissions to edit the configuration of the project. I believe as they are doc references, they should be available to read users of the project.

      https://issues.jenkins-ci.org/browse/JENKINS-36047

    Thanks guys - I was able to find the new link.

    I did open a new related bug to this one, as the links are only shown to users who have permissions to edit the configuration of the project. I believe as they are doc references, they should be available to read users of the project.

    https://issues.jenkins-ci.org/browse/JENKINS-36047

  18. jenkins-infra-bot commented on Dec 8, 2025

    @jenkins-infra-bot
    Author

    [Original is_duplicated_by from Jira: JENKINS-34147]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions