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?
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
}
Best regards, Vera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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):
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I guess the script used was copied/inspired from here:
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Attached below is a screenshot of my behavior.
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.
Best regards, Vera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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".
Hast du eine Idee wie der Code aussehen müsste resp. wie die Config sein muss?
LG, Vera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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)
LG
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Deshalb finde ich es sehr speziell, dass die Description nie angezeigt wird..
LG, Vera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vera_wyss
sehr merkwürdig. 2 Fragen:
LG
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vera,
Welcome to the Atlassian Community.
Can you advise what version of Scriptrunner you are running please?
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Go to Administration > Manage Apps > expand on Scriptrunner:
You can see the modules enabled on the right hand side:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks, there are 267 modules and we have 264 enabled.. the following 3 are disabled
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.