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

yoelcrane August 10, 2017

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
TAGS
AUG Leaders

Atlassian Community Events