How to get script file path for implementing script post fucntion usin script runner plugin in jira ?

Nagmani Nagmani January 31, 2012

I am unable to know the script file path to use the script to get executed automatically whenever I create the post function for each issue type under create issue.

I can use the groovy script successfully thorugh script runner but while trying to use it throuigh scipt post function I need to pass the script filepath Which I dont know how to do.I place the path as "C:\Documents and Settings\nagamani.sinha\My Documents\filename.doc" what changes should I make to get the exact path required.

2 answers

1 accepted

3 votes
Answer accepted
Mizan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2012

Hi ,

You need to save the file as .groovy , currently i see that its saved as .doc

You need to provide the path where your file is saved. Its better if you take te path by right clicking on the file and copy paste the path then even enter the file name which is in groovy format.

1 vote
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2012

Yes, as Mizan says. The interpreter is decided by the extension, so it must end in .groovy.

Just put in the full path to the script on disk.

Nagmani Nagmani January 31, 2012

yes I realised it soon after posting this question.

Thanks.

Nagmani Nagmani January 31, 2012

jamie,

HOw to get project name under title page of this script and summary under content page of this while applying this script as a post function under create issue.

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)

Hope you could help me.

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2012

Looks correct, does it work?

Have you changed the URL back after we spent so long getting something that worked?

Suggest an answer

Log in or Sign up to answer