Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Prefill Description in one Request Type on Jira Service Management

Vera_wyss
Contributor
July 2, 2024

Before the update to Jira 9.12.7, i had that the description was prefilled in one Request Type with a Script Runner Behaviour and it worked until the last update to Jira Data Center 9.12.7 and Jira Service Management 5.12.7. So does anyone know, how to do a description prefill just for one Request Type?

 

3 answers

1 accepted

1 vote
Answer accepted
Vera_wyss
Contributor
August 5, 2024

Solution

I made an inquiry to the manufacturer and have now been away for 2 weeks. During this time there are Bug fix updates from the Script Runner app. Now that i have updated the app to version 8.33.0, my template is working as desired again. 

Unfortunatly I don't know which bug fixed my problem but that means my code and settings were correct.

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
August 5, 2024

Thanks for getting back with this information and letting the community know. 

Good to know it‘s working now and your problem is solved.

Best
Stefan

Like Vera_wyss likes this
0 votes
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 8, 2024

Hi @Vera_wyss 

Would it be possible to share your custom behavioue code? (as it should be prefilled on the create I guess it appears in the initializer ?)

Furthermore:

Is the code/initializer activated at all? Is there a run logged? And if yes: what does the log tell?

Best
Stefan

Vera_wyss
Contributor
July 8, 2024

Hi @Stefan Salzl 

Thank you for the feedback, I have added the code below. The Behaviour is also linked to the corresponding project and the associated issue type.

def desc = getFieldById("description")

def defaultValue = """

   

*Testdescription*

   

Test1:

Test2:

Test3:

   """.replaceAll(/    /, '')

if (!underlyingIssue?.description) {

    desc.setFormValue(defaultValue)

}

 

  • Is the code/initializer activated at all? --> Not sure, where can I activate it?
  • Is there a run logged? --> No, there is no run logged.

 

Best regards, Vera

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2024

Hi @Vera_wyss 

sorry for the confusing wording. I meant if the initialiser gets triggered and the code gets excuted. If so you can find the runs right below the script field. in general the script should be triggered every time the create screen opens (as this is the main part of the initialiser). so there should be runs logged (there are no runs in the screenshot but in the highlighted field you should find runs/executions on your side):

image.png

 

The question for me is the if statement:

Why the following statement?:

(!underlyingIssue?.description)

 

This will only result in true when there is NO description field in the issue. Then it will execute the block within the if (which could not be executed as there is no description field).

IF the description field DOES EXIST this statement results in FALSE and therefore the code within the IF block never runs and therefore the description field is never pre-filled.

Best
Stefan

Vera_wyss
Contributor
July 9, 2024

Hi @Stefan Salzl 

Okei i understand. 

I didn't program the code myself and therefore can't say exactly why this statement is stored like this. What's strange is that I actually didn't change anything in the code but after the update it no longer works.

Do you have an idea how i should configure the statement that my behaviour is working again? 

Best regards, Vera

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2024

I guess the script used was copied/inspired from here:

https://docs.adaptavist.com/sr4js/latest/features/behaviours/behaviours-tutorial#id-.BehavioursTutorialv8.5.0-default-description

 

This makes sense is the script from the link checks if the field has a value. 

I would suggest to change the line to exactly the line as described in the link. (assuming it is written in a behaviour in the initialiser - you then don´t need to set the underlying issue):

if (!desc.formValue) {

    desc.setFormValue(defaultValue)

}

 

Best
Stefan

Vera_wyss
Contributor
July 9, 2024

Hi @Stefan Salzl 

I only need the description when I open an specific IssueType via the Service Desk, it should then display the description directly there.

Unfortunately, if I adapt the code as you suggested, I still don't see the description in the Service Desk and the corresponding IssueType.

Do I need to pay attention to anything else?

Best regards, vera

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2024

Hi @Vera_wyss 

Could please post a screenshot of your whole behaviour as well as where you would expect the prefilled description.

This makes it easier for the community and me to see and analyse the whole configuration.

Thanks in advance.

Best

Stefan

Vera_wyss
Contributor
July 9, 2024

Hi @Stefan Salzl 

Attached below is a screenshot of my behavior.

Screenshot 2024-07-10 071711.png

If I go to Jira Service Desk, select the customer service project and the issue type TEST, the description created with the behavior should appear.

Untitled.png

Best regards, Vera

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 10, 2024

Hi @Vera_wyss 

wie ich anhand des Screenshots erkennen kann können wir auch in meiner Muttersprache schreiben :)

1. Das script auf dem Screenshot ist immer noch unverändert. Es hat immer noch das gleiche if statement. Bitte das wie in meinem vorherigen post angeführt ändern.

2. Dies soll im customer portal angezeigt werden. Das ist ein wichtiges Detail, da dies laut Hersteller eigens im mapping angeführt werden muss, siehe folgenden Link:

https://docs.adaptavist.com/sr4js/latest/features/behaviours/behaviours-with-service-management

Vera_wyss
Contributor
July 10, 2024

Hi @Stefan Salzl 

Ah das ist super :) Danke für deine Hilfe bis jetzt.

Sorry das hatte ich natürlich angepasst und auf der falschen Instanz den Screenshot gemacht. Der Behaviour wird aber nie ausgeführt.

Zu Punkt 2, danke für den Hinweis, bin aber irgendwie nicht fähig das so zu konfigurieren, dass es funktioniert.

Ich habe den Issue Type "Service Request" und den Request Type mit Request Name "TEST". 

Screenshot 2024-07-10 154859.png

Hast du eine Idee wie der Code aussehen müsste resp. wie die Config sein muss?

LG, Vera

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 11, 2024

Hi @Vera_wyss 

Ich seh in deinem Mapping im Behaviour nur 1 Projekt und das sieht mir eben aus wie das ServiceManagement Projekt (also das interne Projekt in dem die Service Agents arbeiten) und nicht das CustomerPortal (das für Customer zugängig ist). Leider hab ich keinen Zugang zu einer ServiceManagement Instanz auf einem DC, sondern nur in einer Cloud-Umgebung und da sieht das anders aus :-/

Soweit ich die Doku richtig verstanden habe sollte das Mapping auf das CustomerPortal möglich sein (so wie es auch aufs Projekt möglich ist).

Was bekommst du denn für eine Auswahl wenn du das Mapping öffnest/bearbeitest bei den Feldern Project/IssueTypes (siehe Screenshots)

image.pngimage.png

 

LG

Stefan

Vera_wyss
Contributor
July 16, 2024

Hi @Stefan Salzl 
Merci für die Antwort. Ich habe die Option "Use Service Desk Mapping" auszuwählen und das habe ich auch gemacht und trotzdem funktioniert es nicht. Hab dir unten einen Screenshot angehängt, welcher das zeigt.

Screenshot 2024-07-16 124512.png

 

Deshalb finde ich es sehr speziell, dass die Description nie angezeigt wird..

 

LG, Vera

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 16, 2024

Hi @Vera_wyss 

sehr merkwürdig. 2 Fragen:

  1. Wurde das behaviour/das script immer noch nicht aktiviert? falls doch: Was sagt das Log file) (siehe screenshot einige posts vorher) ?
  2. nur im sicher zu gehen: is das behaviour sicher enabled??

LG

Stefan

Vera_wyss
Contributor
July 17, 2024

Hi @Stefan Salzl 
Finde ich eben auch. 

Es steht immernoch "Has not run yet" (dieses Mal mit angepassten Code von dir).

Das behaviour ist enabled, habe gerade noch einmal geschaut. 

LG, Vera

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 18, 2024

Hi @Vera_wyss 

Meine letzte Idee (nachdem ich das leider nicht selbst nachstellen kann) wäre, das behaviour nochmal komplett neunzu erstellen.

Ist zwar sehr komisch, kommt aber vor, dass das beim Bearbeiten glitchy wird und dann nicht wie gewünscht funktioniert :-/

LG
Stefan

Vera_wyss
Contributor
July 19, 2024

Hi @Stefan Salzl 

Habe ich ein paar Mal auf verschiedene Arten versucht und hat leider nicht geklappt :( 

Danke trotzdem für deine Hilfe und Zeit. Mal schauen ob ich irgendwann eine Lösung finde :D

LG, Vera

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 19, 2024

@Vera_wyss 

Und der Issue-Type/Request-Type passt auch sicher?

Tut mir leid dass ich da nicht weiterhelfen kann :-/

Ich würde auf jeden Fall dazu raten, den Support von Adaptavist zu kontaktieren. Die können das eventuell genauer analysieren bzw. weitere Infos geben.

Alles Gute damit. Sofern du eine Lösung gefunden hast - darf ich dich bitte diese hier zu posten? Das kann für andere User sehr holfreich sein.

LG
Stefan

Vera_wyss
Contributor
July 19, 2024

@Stefan Salzl 

Ja, der passt. Habe aber auch versucht wenn ich nicht spezifisch den Type auswähle, hat auch nicht geklappt.

Kein Problem, ich war trotzdem froh um deine Hilfe, hätte ja auch klappen können :)

Werde mich mit Adaptavist in Verbindung setzen und schauen ob ich so eine Lösung erhalte.

Danke und klar, werde sobald ich eine Lösung habe diese hier posten, damit es für alle hilfreich ist.

LG, Vera

Like Stefan Salzl likes this
0 votes
Ciara TN
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 3, 2024

Hi Vera, 

Welcome to the Atlassian Community. 

Can you advise what version of Scriptrunner you are running please? 

Thank you 

Vera_wyss
Contributor
July 3, 2024

Hi Ciara, thank you.
We use Script Runner version 8.31.0
Best regards

Like John Funk likes this
Ciara TN
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 3, 2024

Can you check if all modules are enabled in the app? 

And that the behaviour itself is enabled.

If it is enabled then can you see it being executed when the form is loaded? 

Like John Funk likes this
Vera_wyss
Contributor
July 3, 2024

where do i find the modules in the app?

the behaviour itseld is enabled.

no it is not executed, there is nothing in the execution.

Like John Funk likes this
Ciara TN
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 3, 2024

Go to Administration > Manage Apps > expand on Scriptrunner: 

You can see the modules enabled on the right hand side: 

image.png

Like John Funk likes this
Vera_wyss
Contributor
July 3, 2024

thanks, there are 267 modules and we have 264 enabled.. the following 3 are disabled

  • configuration-manager-spi-handler-packages
  • Canned comments resource (jsd-canned-comment-loader)
  • Resource for fragment popup helper (fragment-resource)

 

Like John Funk likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events