Manual:Extension/IssueTrackerLinks: Difference between revisions

No edit summary
No edit summary
Line 2: Line 2:


== Configuration ==
== Configuration ==
A wiki administrator needs to define which issue links are tracked in the wiki. This is done on page <code>MediaWiki:IssueTrackerLinksConfig.json</code>.  
A wiki administrator needs to define which issue links are tracked in the wiki. This is done on page <code>MediaWiki:IssueTrackerLinksConfig.json</code>. This page  is  pre-created and filled with common issue trackers.
 
The Configuration is a JSON object, where key is a unique ID for the tracker and value is an object with the following properties:
 
* <code>url</code> -
* <code>label</code> - optional - message key or string message to be used as a label for this tracker type
* <code>display-mask</code> -
* <code>sequence</code> -
 
{| class="wikitable" style="width: 100%;"
! style="width:120px;" |Property
!Description
|-
| style="width:120px;" |<code>url</code>
|mandatory - URL pattern for the tracker links. Any variable parts can be replaced with a variable (e.g. <code>{repo}</code>, <code>{id},</code>... ) <code>"<nowiki>https://github.com/{owner}/{repo}/issues/{id}</nowiki>"</code>
|-
| style="width:120px;" |<code>label</code>
|optional - <br />message key or string message to be used as a label for this tracker type
|-
| style="width:120px;" |<code>display-mask</code>
|optional - <br />how this tracker link should be represented in page. For example:
<code>Github: {id}</code>, would render it as <code>Github: 6</code>
|-
| style="width:120px;" |<code>sequence</code>
|optional -<br /> if you want to be able to auto-convert certain sequences in VisualEditor to tracker links, specify mask here. For example,  if the mask is defined as <code>GH{id}</code>, then any <code>GH123</code> sequence will be converted to a link to the tracker with <code>id=123</code>, or <code>GH:{repo},{id}</code> for <code>GH:example-repo,123</code>, where <code>repo=example-repo</code> and <code>id=123</code>. <br />Note that if the URL mask contains more variables than are present in sequence,  itwill lead to broken links. Recommended is to use sequences only for URLs with one variable, such as issue IDs.
|-
| style="width:120px;" |
|
|}


== How it works ==
== How it works ==

Revision as of 10:28, 20 October 2025


The IssueTrackerLinks extension handles the rendering of links to external issue tracker applications, such as GitHub, GitLab, Jira, or EasyRedmine. Administrators can define which applications are available as issue tracker links.

Configuration

A wiki administrator needs to define which issue links are tracked in the wiki. This is done on page MediaWiki:IssueTrackerLinksConfig.json. This page is pre-created and filled with common issue trackers.

The Configuration is a JSON object, where key is a unique ID for the tracker and value is an object with the following properties:

  • url -
  • label - optional - message key or string message to be used as a label for this tracker type
  • display-mask -
  • sequence -
Property Description
url mandatory - URL pattern for the tracker links. Any variable parts can be replaced with a variable (e.g. {repo}, {id},... ) "https://github.com/{owner}/{repo}/issues/{id}"
label optional -
message key or string message to be used as a label for this tracker type
display-mask optional -
how this tracker link should be represented in page. For example:

Github: {id}, would render it as Github: 6

sequence optional -
if you want to be able to auto-convert certain sequences in VisualEditor to tracker links, specify mask here. For example, if the mask is defined as GH{id}, then any GH123 sequence will be converted to a link to the tracker with id=123, or GH:{repo},{id} for GH:example-repo,123, where repo=example-repo and id=123.
Note that if the URL mask contains more variables than are present in sequence, itwill lead to broken links. Recommended is to use sequences only for URLs with one variable, such as issue IDs.

How it works

For example, an administrator has configured issue tracking for GitHub:

{
	"github": {
		"url": "https://github.com/{owner}/{repo}/issues/{id}",
		"label": "issuetrackerlinks-type-label-github",
		"icon": "github",
		"display-mask": "{owner}/{repo}#{id}"
	}
}

Copy and paste

With the above configuration, you can now paste the following link in a wiki page:

https://github.com/wikimedia/edx-platform/issues/553

The URL label will be visually formatted as an issue tracker url with the text string of the display-mask parameter that is defined for GitHub in your wiki.

Formatted shortened link label for a GitHub issue
GitHub issue link


Content droplet

Some issue links can be entered as content droplet:

  • GitHub issue link
  • GitLab issue link



PDF exclude - start

To submit feedback about this documentation, visit our community forum.

PDF exclude - end