How create link with Issue ID in Web Item?

I created simple endpoint for generate PDF. It works, but I wanna send Issue ID to this API when I click the web-item button on Issue page , ex. (I am in Issue page with ID 123) /rest/example/1.0/export/pdf?id=123

It is possible to do that?

Now It looks something like that:

  <web-item key="export-issue-pdf" name="Export PDF" section="" weight="200">
      <link linkId="export-issue-pdf">/rest/example/1.0/export/pdf</link>

You should be able to use a magic property in the web-item, if you are on the issue view. If you look at this example (taken from the Jira source code), you will see that you can use ${} in the link:

    <web-item key="add-attachments-link" i18n-name-key="webfragments.view.issue.attachments.create" name="Create an Attachments" section="com.atlassian.jira.jira-view-issue-plugin:attachmentmodule/header" weight="1">
        <label key=""/>
        <tooltip key=""/>
        <styleClass>issueaction-attach-file aui-icon aui-icon-small aui-iconfont-add issueaction-aui-icon</styleClass>
        <link linkId="add-attachments-link">
        <condition class="com.atlassian.jira.plugin.webfragment.conditions.CanAttachFileToIssueCondition"/>
1 Like