import org.swift.common.soap.confluence.ConfluenceSoapServiceServiceLocator
def locator = new ConfluenceSoapServiceServiceLocator()
def service = locator.getConfluenceserviceV2(new URL("http://localhost:8090"))
def token = service.login("admin", "password")
def page = new RemotePage (
content: issue.description,
creator: "admin",
title: issue.summary,
space: "DS",
homePage: false,
created: Calendar.getInstance(),
modifier: "admin",
version: 1,
modified: Calendar.getInstance(),
)
service.storePage(token, page)
I am using the above code where I need to create automatic page in confluence for a project for any issue created under that project in JIRA.
I have downloaded groovyrunner plugin. and I could use the script runner plugin in my JIRA successfully . But whenever I am trying to run the above code I am getting result as "
Community moderators have prevented the ability to post new answers.
I guess I need to do some changes in my installation of groovy..because this url is not working in my script and showing error..
Thanks..
Hi jamie,
I am getting the wsdl page while using this link http://localhost:8085/rpc/soap/jirasoapservice-v2?wsdl for jira but for confluence http://localhost:8090/rpc/soap-axis/confluenceservice-v1 is not showing the desired page..
anything more could you suggest for any improvement.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well..After doing some changes now I can see the wsdl page using url.(http://localhost:8090/rpc/soap- axis/confluenceservice-v1...Thanks for the help..but still the problem is there I am gettin error as
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you tell me the exact name of the file you copied to web-inf/lib from the confluence CLI plugin, please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
its confluence-soap 4.0.0.jar file... and groovy 1.7.14.jar
Do I need to copy any more files..?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, you're just missing your import. Put this at the top:
import org.swift.common.soap.confluence.RemotePage
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you copy the confluence-soap-model jar? If so what was the exact file name? Also where did you copy it to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I kept it in following folder C:\Program Files\Atlassian3\JIRA\atlassian-jira\WEB-INF\lib
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
import org.swift.common.soap.confluence.ConfluenceSoapServiceServiceLocator
def locator = new ConfluenceSoapServiceServiceLocator()
def service = locator.getConfluenceserviceV2(new URL("http://localhost:8090/confluence/rpc/soap-axis/confluenceservice-v1"))
def token = service.login("admin", "password")
def page = new RemotePage (
content: “groovy_working”,
creator: "admin",
title: “groovy”,
space: "groovy",
homePage: false,
created: Calendar.getInstance(),
modifier: "admin",
version: 1,
modified: Calendar.getInstance(),
)
service.storePage(token, page)
I have made these changes as i didn't created any issue so issue.description wouldnot be valid in my context of code...help me if I did anything wrong.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please let me know what changes should I make in the url field to get the fqdn format...as I think what I am passing as url is my fqdn...("http://localhost:8090")).. what should be added to get fqdn if its not the fqdn
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've asked you before and I'm going to ask you again. Do you see a page when you go to: http://localhost:8090/confluence/rpc/soap-axis/confluenceservice-v1 ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I get a page but with the tag "PAGE NOT FOUND"...I can redirect to my own dashboard with the link in that page but I dont get my confluence home page while clicking on this link....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes I get a page but with the tag "PAGE NOT FOUND"...that page is having the link through which I can direct my self to my dashboard of confluence...But I dont get my confluence home page at once while clicking on the above link....
The page you were trying to reach could not be found. This could be because:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Right, so your task is to work out where the wsdl is. How about:
http://localhost:8090/rpc/soap-axis/confluenceservice-v1?wsdl ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am getting followin page which I think is again of no use as such..
Hi there, this is an AXIS service!
Perhaps there will be a form for invoking the service here...
Dont know exactly how to figure this out..will have to work on this..
Thanks a lot for your constant support..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you paste here the exact url you used to get the above, and the url you are using in your script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Anyway that looks like the correct url, so make sure that is the url you are using in your script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
the one u send me..
http://localhost:8090/rpc/soap-axis/confluenceservice-v1?wsdl ? as my port no is same as yours 8090.
and the one I am passing in my script is ("http://localhost:8090/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What you need in your script is: http://localhost:8090/rpc/soap-axis/confluenceservice-v1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep exactly..Now the problem is resolved for remote pages... You are really giving me a gr8 help... Wanted to know one more thing what shoould be the value in "content" as it is showing error in case if I pass some constant string value as in above case where I have passed "groovy-working"...Any more suggestions for this case...
Thanks..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to tell us what the error is, and yes I am giving you some gr8 help, so can you vote up my answers and comments.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
javax.script.ScriptException: groovy.lang.MissingPropertyException: No Such property: "groovy_working" for class: Script3
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the points, much appreciated.
In your code, you put "groovy_working", with the quotes, but the error implies that you didn't have any quotes, so it's treating it as a variable you haven't defined.
There are lots of good short groovy, and java, tutorials out there. You can get far with just seeing what works, but in the end learning a bit of the language is a good investment of your time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Jamie for your constant support...And finally I could say I got the desired output..It really works..!!!
Very useful plugin for sure..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great, well done. And thanks.
Final step is to mark one of my answers as correct, by clicking the tick mark/check mark.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
jamie,
The code is working fine with the constant string value that I am using in my above script.
1. I want this to trigger using post function whenevr a new issue is created under any project.
BUt I am unable to retrieve the "issue key" to use it in my script.
2. and the script path that I am giving to the post function is also not working as I gave it as "C:\Documents and Settings\nagamani.sinha\My Documents\job.doc" I am not sure what changes to make...
See if you can help me for this.
Thanks,
Nagmani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using this scriptof yours to get the issue key so as to use it in thecontent part of script instead of the fixed value that I have set right now..:
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.ComponentManager;
import com.atlassian.jira.issue.CustomFieldManager;
import com.atlassian.jira.issue.fields.CustomField;
import org.apache.log4j.Category
log = Category.getInstance("com.onresolve.jira.groovy.PostFunction")
log.debug "Issue key is ${issue.key}"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You really should be asking a new question...
The filename should end in .groovy.
What output do you get for your line? If nothing try log.warn(...).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I pasted the whole script in a doc file and kept that in mydocuments folder.
So I gave the script file path as "C:\Documents and Settings\nagamani.sinha\My Documents\job.doc"
Do I need to just change the extension as ".groovy" or something else need to be done.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please answer this question on below link as I have asked this question separately on below linkl.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
how to get the project name in "title" field and its summary in content field...currently I am passing a constant tring value in these columns but this wont serve my purpose unfortunately.
Please suggest me how to get project name under title field whenever I write postfunction for a create issue under that project...
Thanks
Nagmani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You need to ask a new question. Asking different questions in the same thread doesn't help people find similar problems.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
kindly check this thread for my new question and please help me if you could.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I get a page but with the tag "PAGE NOT FOUND"...I can redirect to my own dashboard with the link in that page but I dont get my confluence home page at once while clicking the above url link
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Don't use this version of the script, I just wrote that off the top of my head. The other one I actually tested.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
package examples
import org.swift.common.soap.confluence.ConfluenceSoapServiceServiceLocator
def locator = new ConfluenceSoapServiceServiceLocator()
def service = locator.getConfluenceserviceV2(new URL("http://localhost:8090/"))
def token = service.login("admin", "password")
def page = service.getPage(token,"MYSPACE","groovy")
page.content = "groovy_created"
service.updatePage(token, page)
for this code I am getting the error as a result:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.