data-target-options is not working in message card.

Here is my card json:

{ "message":"<b>test1<b>", 
"card":{
 "style": "link",
 "id": "sldhfgsidhg-sdfhdfh-dfghdfgh",
 "title": "Test for checking.",
 "description": {
 "format": "html",

 "value": "<b>Add-on link:</b> <a href='#' 
data-target='test-page' 
data-target-options='{\"options\":{\"title\":\"Custom Title\"}, 
\"parameters\":{\"article_id\":\"1234\"}, {\"urlTemplateValues\": 
{\"article_id\": \"12345\"}}}'>Open Dialog with parameters</a>"
 },
 "date": 1443057955792
},
"message_format" : "html"
}

 

 

I have capabilities as

"externalPage": [
{ "key": "test-page","url": "{baseURL}?article={article_id}", "name": { "value": "Test Click"}}
]

I want to pass article ID for external page link which should open in browser with JWT and  article_id as parameters. When I click on message card link, article_id is not replaced with value which i sent in data-target-options.


Can you guys please help me out.

1 answer

1 accepted

This widget could not be displayed.

Hi Ramesh,

You should put your parameters in message.metadata as described here and then it should work.

Thanks a lot. That works.

How can I use data-target in "url" in card.

Example: "url": "<a href='#' data-target='test-page'></a> "

This is not working for me.

 

Regards

Ramesh

 

 

I would like to target the link URL to external page which should be similar to "data-target", so that I can get user context in my plugin.

I see. It is not possible right now. We have an issue for target url (internal) https://jira.atlassian.com/browse/HC-30017

 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 10, 2018 in Hipchat

What should I think about when migrating HipChat to Slack?

...from the beginning. We have built up a lot of content in HipChat, with it being a core tool in our distributed company model. While it is true that we didn’t need to move to Slack immediately, we felt it...

386 views 1 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you