Create a link to an issue from an custom field value with the jmwe add-on

Mikael Rudberg March 26, 2020

Im trying to create a blocked step in my task workflow where lets you enter a issue key in a string field on a popup screen and then create a blocked by link in the JWME add on.

im trying to use the "Link issues to the current issue (JMWE add-on)" function but i can't get it to work

my screen looks like this

Any ideas if this is possible or not

Regards

/Mikael

 

Capture.PNG

3 answers

1 accepted

0 votes
Answer accepted
Mikael Rudberg March 27, 2020

I actually managed to figure it out

I used the following groovy in the 

Link Issues to the Current Issue Post-function

<% if (issue.get("Blocked By"))
print "issuekey=${issue.get("Blocked By")}"
else
print "issuekey=INVALID-1"
%>

and in the validator

issue.get("Blocked By") != null 

 

 

Then in the blocking task i added the following with the 

Transition Related Issues Post-function trigger

<% 
value = issue.getLinkedIssues("blocks");
if (value) {
sb = new StringBuilder();
value.each {
status = ComponentAccessor.issueManager.getIssueObject(it.toString()).getStatus().getName();
if (status == "Blocked"){
if (sb.length() > 0 )
sb.append(", ");
sb.append(it)
}
}
String result = sb.toString()
if (sb)
print "issuekey in (${sb})";
else
print "issuekey = IN-1";
}
else
{
print "issuekey = IN-1";
}
%>

 

and in the validator

issue.getLinkedIssues("blocks").size > 0
1 vote
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 27, 2020

Hi Mikael,

are you on Jira Server/DC or Jira Cloud? It's possible on both but the solution is slightly different. In both case, you'll use the Link Issue(s) post-function with a simple JQL expression, but the syntax is slightly different.

As for John's comment, it's true (but of course only on Jira Cloud) with the caveat that Automation is only free for project-specific rules (rules that apply only to a single project). Global and multi-project rules are limited to 500 rules executions per month (across all rules) unless you have a Jira Premium subscription. And one rule execution, in a case like this, means one transition on one issue, so unless you only have a few users, you'll hit the limit very very quickly.

John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 27, 2020

Well said!

0 votes
John Funk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 27, 2020

Hi Mikael - Welcome to the Atlassian Community!

You might try doing that with Automation For Jira, which is now free in Jira. It will provide you more flexibility and ease of use. 

However, you can contact David and his crew with JMWE with a support ticket and they will help you out.  :-)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events