Forums

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

Can I create an automation that captures time stamp and user who initiated it with Scriptrunner?

Hector Hood
Contributor
February 16, 2022

I need to create a script/automation for Jira Datacenter with Scriptrunner.

Scenario: 

User initiates Time Stamp when selecting a field.

Captures time in Date and Time Picker.

Captures Initiator Display Name in Text Box.

1 answer

0 votes
Fabio Racobaldo _Herzum_
Community Champion
February 16, 2022

Hi @Hector Hood ,

you can do that using a behaviour provided by script runner.

When user select a filed (that field should be added to the behaviour) you could retrive who and when operation has been performed and put those information in two different custom fields (that should on the same screen).

If you provide all information I could send you an example.

Hope this helps,

Fabio

Radek Dostál
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.
February 16, 2022

This would require that both the Date and Display Name are present on the same form as the Time Stamp field. (Since behaviours are javascript-based and will not update the issue in background silently.)

Another requirement (I think? Not sure..) is that the user must use the Edit dialog, and not just switching the field on issue view. I don't know however if behaviours will make the user go to Edit dialog, or whether the user would be able to modify the field as is, in plain view.

 

If any of these are problem I would more point towards Listeners https://scriptrunner.adaptavist.com/latest/jira/listeners.html since these can run in the background.

Hector Hood
Contributor
March 15, 2022

@Fabio Racobaldo _Herzum_ sorry for the delay this got backlogged.

User Clicks on Timestamp

This puts date into Date Picker which is read only

Put in User into User Picker and is read only.

What other info would you need?

Hector Hood
Contributor
March 15, 2022

@Radek Dostál would you have an example on how to build this listener?

Suggest an answer

Log in or Sign up to answer