JMWE - Set issue's field to parent's key (as a hyperlink)

Aslıhan Paksoy October 5, 2021

Hi,

I'm trying to set the issue's field to its parent's url.

I can get the key of parent but I cant reach the parent's url.

Parent: TD-10

Sub-task: TD-11

I want "TD-10" in TD-11's screen as a hyperlink.

I tried below,

JMWE.jpg

Can anyone help?

 

Thanks

2 answers

1 accepted

1 vote
Answer accepted
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2021

Hi @Aslıhan Paksoy and welcome to the community!

Which field are you trying to place, and where exactly? You want to place the parent's URL on the e.g. summary of the child issue? 

Aslıhan Paksoy October 5, 2021

Hi @Alex Koxaras _Relational_ , I have a text field in the sub-task , I'm trying to place the parent's URL on this field.

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2021

I would use:

https://YOURINSTANCENAME.atlassian.net/browse/{{ issue.fields.parent.key }}

But, I would definitely try to find another way to get the base url from JMWE. Give me a couple of minutes.

And I would add a condition for that post function to run only if parent issue exists (unless you have this PF on a workflow used only by a subtask) 

Aslıhan Paksoy October 5, 2021

Does the field have to be a text field or url field?

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2021

I would make it a URL field.

Aslıhan Paksoy October 5, 2021

I wrote in JMWE


[{{parentIssue.fields.summary}}|https://myinstance/browse/{{parentIssue.key}}]

I'm trying to insert an hyperlink; summary of parent will be seen as link alias

:( url field gives an error:
customfield_10201: Specify a valid URL for the Custom Field

Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2021

Yes, because this is not a valid URL. You are trying to enter a URL as a [MYSUMMARY|https://myinstance/browse/YOURKEY]

The valid URL would be only the code I've given you (starting with https). If you want to include the summary and the wiki notation, then use a text field.

Aslıhan Paksoy October 5, 2021

I have tried this,

jmweTest.jpg

But in the issue view, this is the result, summary and key is not shown
jresult.jpg

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.
October 5, 2021

Hi @Aslıhan Paksoy ,

the parentIssue variable is only available in post-functions that operate explicitly on the parent issue. Here, the post function operates on the current issue (the issue on which you're setting the field value). To access the current issue's parent, you need this:

[{{issue.fields.parent.fields.summary}}|URL/browse/{{issue.fields.parent.key}}]
Like # people like this
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2021

Do what David told you :)

Aslıhan Paksoy October 5, 2021

@David Fischer hi, values are okay but now the link is not clickable :(

jwme.jpgjwmelink.jpg

Suprija Sirikonda _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 5, 2021

Hi Aslihan,

The field should've "Wiki Style Renderer" for the value to be displayed as expected.

However, in the new issue view, Short text only supports plain text, so the renderer settings don't apply. Use the Paragraph custom field for rich text like links to URLs.

Thanks,

Suprija

Aslıhan Paksoy October 5, 2021

@Suprija Sirikonda _Appfire_ I have created another field like you said but it did not work,

rich.jpg

Suprija Sirikonda _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 5, 2021

Hi @Aslıhan Paksoy ,

Does the field have "Wiki Style Renderer"? 

What's the type of the field and on which view(new/old) you're seeing this?

Regards,

Suprija

Aslıhan Paksoy October 5, 2021

Okay, I have changed my field's renderer. Unfortunately it was default text renderer. Sorry and thank you all for helping me :)

Suprija Sirikonda _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 5, 2021

Great to hear that!

1 vote
Sayed Bares {Appfire} October 5, 2021

Hi Aslihan,

To get the URL you will need to use the following URL:

{{null | serverInfo | field("baseUrl")}}

For more details please check our documentation linked below:

 So your template in Set issue field post function should be something like this:

{% if issue.fields.parent.key %} [{{issue.fields.parent.key}}|{{ null | serverInfo | field("baseUrl")}}/browse/{{ issue.fields.parent.key }}] {% endif %}

result.png

Hope it helps and let us know how it goes.

Aslıhan Paksoy October 5, 2021

I cant find Groovy option in JMWE :(

Sayed Bares [ServiceRocket]
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 5, 2021

Hi Aslihan, 

I just noticed you are using JMWE for Jira cloud, I have updated the above solution accordingly. Let us know if you were able to get the parent issue URL.

Aslıhan Paksoy October 6, 2021

Thanks, David's way have worked , but I will try this to

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events