How to I make an IF inside atlassian-plugin.xml that change behaviour based on the server domain name?

I am looking for something like:

# if jira.baseurl == "http://xxx"




But my velocity syntax si very limited at this moment.

2 answers

1 accepted

0 votes
Accepted answer

Well, if thats the question, the asnwer is that you can't embed velocity in your atlassian-plugin.xml, you can however have a webwork action, who's success/other response is redirected to a velocity template for rendering. For velocity syntax information, see :

0 votes

Um, your question doesn't quite make sense.

The title says you're trying to do something in atlassian-plugin.xml, but then you talk about some velocity code. Rather than try to unscramble this muddle, I'll try to break it into pieces

  • atlassian-plugin.xml is for settings in your plugins. It's an xml file, not velocity
  • The velocity is broadly the right idea, but
    • The "if" clause needs to be in ()
    • there's no spaces in directives (#if, not # if)
    • I think the jira.baseurl is correct, but don't rely on me
    • It does however, need to be a variable - $jira.baseurl
  • Your velocity needs to go into a velocity template file, somewhere within your plugin

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,152 views 5 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