Need help creating confluence page based on value in a custom field Edited

My goal is to make a confluence page when someone sets a custom field to a particular value, i.e. create a troubleshooting document.

I have JIRA Version 7.3,  ScriptRunner 5.0.14, and Confluence 6.1.3

I'm trying to combine the examples below to run under a script listener for when the a jira is created or updated.

https://scriptrunner.adaptavist.com/5.0.14/jira/interacting-with-confluence-from-jira.html

https://community.atlassian.com/t5/JIRA-questions/How-to-get-the-custom-field-value-using-by-groovy-script/qaq-p/385870

At this point in time I have made a mess of things and no page is created. Any tips or code to share would be appreciated. 

Yoel

 

**Updated with errors 8/14

This is what I am getting back, although I was underthe impression I can ignore these.  

There was an error during the execution of your script

Message:
Compilation error(s):
Script1.groovy: 9: unable to resolve class com.atlassian.sal.api.net.Response
 @ line 9, column 1.
   import com.atlassian.sal.api.net.Response
   ^
Script1.groovy: 12: unable to resolve class groovy.json.JsonBuilder
 @ line 12, column 1.
   import groovy.json.JsonBuilder
   ^
Script1.groovy: 4: unable to resolve class com.atlassian.applinks.api.ApplicationLinkService
 @ line 4, column 1.
   import com.atlassian.applinks.api.ApplicationLinkService
   ^
Script1.groovy: 11: unable to resolve class com.atlassian.sal.api.net.ResponseHandler
 @ line 11, column 1.
   import com.atlassian.sal.api.net.ResponseHandler
   ^
Script1.groovy: 10: unable to resolve class com.atlassian.sal.api.net.ResponseException
 @ line 10, column 1.
   import com.atlassian.sal.api.net.ResponseException
   ^
Script1.groovy: 8: unable to resolve class com.atlassian.sal.api.net.Request
 @ line 8, column 1.
   import com.atlassian.sal.api.net.Request
   ^
Script1.groovy: 5: unable to resolve class com.atlassian.applinks.api.application.confluence.ConfluenceApplicationType
 @ line 5, column 1.
   import com.atlassian.applinks.api.application.
confluence.ConfluenceApplicationType ^ Script1.groovy: 3: unable to resolve class com.atlassian.applinks.api.ApplicationLink @ line 3, column 1. import com.atlassian.applinks.api.ApplicationLink ^



----------------------

I tried the sample script in the Script Runner Script Console and got the following error

 

No such property: issue for class: examples.docs.Script2

 

groovy.lang.MissingPropertyException: No such property: issue for class: examples.docs.Script2 at examples.docs.Script2.run(Script2.groovy:25)

 

017-08-18 14:30:22,247 WARN [common.UserScriptEndpoint]: Script console script failed: groovy.lang.MissingPropertyException: No such property: issue for class: examples.docs.Script2 at examples.docs.Script2.run(Script2.groovy:25)




0 answers

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Marketplace Apps

Three tips for boosting your board's efficiency with Story Maps

Trello is one of the most effective tools for driving your sprints. It's customizable for every Agile team and product owners and Scrum masters (SM) love it. However, Agile teams often struggle with:...

850 views 2 9
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