Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

IFTTT and velocity

I don't have a lot of control of my confluence configuration and i am not a web developer by trade. so forgive me if i am butchering the definitions.

Im trying to use a confiform to create a JIRA issues

i wanted to use velocity code to help "build an array of labels to add to an issue

But i have had zero luck with using velocity variables in my enviroment.

{ "fields":{
"project":{"key":"somekey"},
"issuetype":{"name":"Software Design"},
"priority":{"name":"Medium"},
"components":[{"name":"[entry.ClassSelector.escapeJSON]"}],
"description":"[entry.issueDetails.escapeJSON]",

#if ("[entry.valueSeverity.escapeJSON]" != "")
"customfield_11853":{"value":"[entry.valueSeverity.escapeJSON]"},
#end

#if([entry.IsShipCheckReq] == true)
#set( $labelStr = "ShipCheckReq," )
#end
#if([entry.IsDiscrep] == true)
#set( $labelStr = "$labelStr discrep," )
#end
#if([entry.IsSafetyCritical] == true)
#set( $labelStr = "$labelStr Safety," )
#end
#if([entry.isFleetsupport] == true)
#set( $labelStr = "$labelStr FleetSupport," )
#end
#if([entry.isTask] == true)
#set( $labelStr = "$labelStr Task," )
#end
#set( $labelStr = "$labelStr""formGenerated""" )

"labels":["$labelStr"],
"summary":"[entry.issueName.escapeJSON]" }
}

 

 

1 answer

1 accepted

Hi

Please see this page on how you actually mix the Velocity with ConfiForms Field value references https://wiki.vertuna.com/display/CONFIFORMS/Configuring+ConfiForms+IFTTT+actions+and+rules#ConfiguringConfiFormsIFTTTactionsandrules-CreateJiraIssue

Especially how to check if the value is given or not.

Alex

thanks for the response.

I think if i knew what i was doing that page would be helpful, but i don't so it wasn't.

 

i wound up solving this by redoing the page as replacing check boxes with a multi select label box.

 

I guess i have another question?

Is it possible to build a string like i was attempting and pass it in as an array of labels?

Consider the following template (I have 3 fields of type checkbox and I am checking their "RAW" value, as described in our docs)

Screenshot 2020-10-09 at 22.50.15.png

 

And the template itself

#set ($labelStr = "") 

#if(${check1})  
#set ($labelStr = $labelStr + "Check1, ")
#end

#if(${check2})   
#set ($labelStr = $labelStr + "Check2,")
#end

#if(${check3})   
#set ($labelStr = $labelStr + "Check3,")
#end

{ "fields": { "project": { "key": "somekey" }, "issuetype": { "name": "Software Design" }, "priority": { "name": "Medium" }, "components": [ { "name": "[entry.ClassSelector.escapeJSON]" } ], "description": "[entry.issueDetails.escapeJSON]", "labels": [ "$labelStr" ], "summary": "[entry.issueName.escapeJSON]" }

thank you for the template!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

156 views 0 5
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you