Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

help with a script

Christian Jaya May 8, 2018

Hi is me again

i'm using Scriptrunner with groovy programing, i need to copy a "summary" systemfield, into a customfield for to make a validation, please can you help me, how can i do that?

if you have a Little script that help me with this trouble, send it please

thank you so much

 

1 answer

1 accepted

0 votes
Answer accepted
Marcos Sanchez
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.
May 8, 2018

Hi,

 

Why do yo need to copy the summary to make the validation?

What are you trying to do?

The summary can be get with a script directly without needing to copy it to another field.

 

Regards,

Marcos

Christian Jaya May 8, 2018

As i said i'm a begginer in this lenguaje, please can you explain me, how i get the "summary" with a script, 

and please another cuestion, is posible use this "summary" in a sql sentence???

please help me with that thank you

Marcos Sanchez
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.
May 8, 2018

Hi,

To get the summary you can use this:

def issueSummary = issue.getSummary()

For you second question:

Yes, you can. Do you want to do it in the same script?

 

Note that using issue will mark it as an error, but it's a false positive unless you are running the script on Script Console.

Btw, tell me what you want to do so I can do a full script and show it to you.

 

Regards,

Marcos

Christian Jaya May 8, 2018

Thank you so much

And yes i want to do this in the same script, i'm using ScriptRunner for JIRA

answering your question, a need to use the "Summary" to make a SQL sentece like this

 

def issueSummary = issue.getSummary()

SELECT id,Summary,due FROM jiraissue WHERE Summary = issueSummary 

Christian Jaya May 9, 2018

Hello 

yesterday i wrotte to you, and i don't recive an answer, please help me, i need to know how to do this 

thank you so much for your answer

Nic Brough -Adaptavist-
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.
May 9, 2018

Forget the SQL, it's slow, complex, painful and not needed for what you're trying to do.

issue.getSummary returns the summary.  Try issue.getKey() and issue.getDueDate for the others.

Marcos Sanchez
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.
May 9, 2018

Hi,

Sorry I was busy and ran out of time.

I was going to answer the same as Nic did.

 

Regards,

Marcos

Christian Jaya May 9, 2018

Thank you so much

only one more cuestion, there are a function issue.getAssignee??

that is the field that I need

Marcos Sanchez
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.
May 9, 2018

Hi,

Yes.

In this link you have all JIRA issue API.

 

Regards,

Marcos

Christian Jaya May 9, 2018

that is so help full

there are a librari that i have to import to use the sentece issue.getAssignee??

Marcos Sanchez
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.
May 9, 2018

Hi,

No, you don't have to import a library to use it except that you run the script on the Script Console.

If you run the script as Listener, Script Field, Behaviour or Workflow you don't have to import a library to use the issue api.

 

Regards,

Marcos

Christian Jaya May 14, 2018

Marcos how are you??

please can you help me???

i have this error and i dont know what is it

 

java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SqlServerDriver

i download a java driver from microsoft and define the ClassPath, but the error are still there

please help me

 

Regards

Marcos Sanchez
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.
May 14, 2018

Hi,

What are you trying to do?

I recommend you to open a new ticket if this is an other problem, because maybe some expert could help you more than me.

 

Regards,

Marcos

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events