File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ class Change implements ChangeInterface
13
13
/** @type string A message describing the change. */
14
14
protected $ _message ;
15
15
16
+ /** @type string A link to the change. */
17
+ protected $ _link = '' ;
18
+
16
19
/**
17
20
* Initialize the change.
18
21
*
@@ -47,6 +50,28 @@ public function getType() : Type
47
50
return $ this ->_type ;
48
51
}
49
52
53
+ /**
54
+ * Sets the link.
55
+ *
56
+ * @param string $link The link
57
+ *
58
+ * @return void
59
+ */
60
+ public function setLink (string $ link )
61
+ {
62
+ $ this ->_link = $ link ;
63
+ }
64
+
65
+ /**
66
+ * Get the link.
67
+ *
68
+ * @return string The link.
69
+ */
70
+ public function getLink () : string
71
+ {
72
+ return $ this ->_link ;
73
+ }
74
+
50
75
/**
51
76
* Get the displayable type.
52
77
*
@@ -64,6 +89,10 @@ public function displayType()
64
89
*/
65
90
public function displayShort () : string
66
91
{
92
+ if (!empty ($ this ->getLink ())) {
93
+ return '* [ ' . strtok ($ this ->_message , "\n" ) . "]( {$ this ->getLink ()}) " ;
94
+ }
95
+
67
96
return '* ' . strtok ($ this ->_message , "\n" );
68
97
}
69
98
Original file line number Diff line number Diff line change @@ -21,6 +21,22 @@ public function setType(Type $type);
21
21
*/
22
22
public function getType () : Type ;
23
23
24
+ /**
25
+ * Sets the link.
26
+ *
27
+ * @param string $link The link
28
+ *
29
+ * @return void
30
+ */
31
+ public function setLink (string $ link );
32
+
33
+ /**
34
+ * Get the link.
35
+ *
36
+ * @return string The link.
37
+ */
38
+ public function getLink () : string ;
39
+
24
40
/**
25
41
* Returns a short markdown snippet of the change for use in release notes.
26
42
*
Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ public function getChangeType(ChangeInterface $change) : Type
55
55
$ issuetype = $ issue ->fields ->issuetype ->name ;
56
56
$ type = $ this ->_typeManager ->getTypeByName ($ issuetype );
57
57
if ($ type !== null ) {
58
+ $ host = $ this ->_issueService ->getConfiguration ()->getJiraHost ();
59
+ $ change ->setLink ("{$ host }/browse/ {$ key }" );
58
60
return $ type ;
59
61
}
60
62
} catch (JiraException $ e ) {
You can’t perform that action at this time.
0 commit comments