Forums

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

Jira Automation - Smart value: Difference between 2 timestamp custom fields in a 3rd custom field

Anand Chittoor
November 2, 2021

Hello, 

Looking for some help here. 

I have researched many community solutions (by @Ravi Sagar _Sparxsys_ , @John Funk, and @Nir Haimov  but still stuck at the last hurdle.

I have the following custom field's below for which automation is working fine. These are timestamp fields.

I want to populate another custom field (number) Time to First Reponse (TTFR), which is the difference between the "Acknowledged timestamp" and "Ready status timestamp", ideally in businessDays. Hours will work too if need be.

Screen Shot 2021-11-02 at 10.04.12 AM.png

I have tested my automation conditions trying to hard code the TTFR edit issue to a number (2). and it populates fine. But when I insert the below formulae, the automation log shows success, but there is nothing outputted in the TTFR field.

-Formulae i have tried under "edit issue" 

  • Acknowledged Timestamp - customfield_14475,
  • Ready Timestamp - customfield_14474

{{issue.Customfield_14474.diff(issue.customfield_14475).hours}} 

or

{{issue.customfield_14475.diff(issue.customfield_14474]).businessDays}}

 

SCREENSHOTS - 

Screen Shot 2021-11-02 at 10.07.56 AM.png

7 answers

1 accepted

2 votes
Answer accepted
Justin Alex Paramanandan
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 Champions.
July 3, 2013

I believe that replacing the "localhost" with your machine's IP address would open up the access of the JIRA instance across the entire network. Hence, your base url should be http://YOUR_MACHINE_IP:8080/UnosysJira

To check for your machine's IP address would be dependant on your OS:

  • For Windows: ipconfig /all ; look under IPv4 Address
Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . : xxx.com
   Description . . . . . . . . . . . : Broadcom NetLink (TM) Gigabit Ethernet
   Physical Address. . . . . . . . . : 00-25-64-BA-40-31
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::f082:9dfe:9af3:bd09%11(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.70.17(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Thursday, July 04, 2013 9:36:56 AM
   Lease Expires . . . . . . . . . . : Thursday, July 04, 2013 5:55:44 PM
   Default Gateway . . . . . . . . . : 192.168.70.5
   DHCP Server . . . . . . . . . . . : 192.168.70.2
   DHCPv6 IAID . . . . . . . . . . . : 234890596
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-19-34-B9-F4-00-25-64-BA-40-31

   DNS Servers . . . . . . . . . . . : 192.168.70.2
   Primary WINS Server . . . . . . . : 192.168.70.1
   NetBIOS over Tcpip. . . . . . . . : Enabled
  • For Unix/Linux: ifconfig ; look under inet addr
# ifconfig eth0

eth0   Link encap:Ethernet  HWaddr 00:2D:32:3E:39:3B
inet addr:192.168.2.2  Bcast:192.168.2.255  Mask:255.255.255.0
inet6 addr: fe80::21d:92ff:fede:499b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:977839669 errors:0 dropped:1990 overruns:0 frame:0
TX packets:1116825094 errors:8 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2694625909 (2.5 GiB)  TX bytes:4106931617 (3.8 GiB)
Interrupt:185 Base address:0xdc00

Found the IP, use it to replace "localhost" in JIRA's General Configuration.

Prajakta Khire
July 4, 2013

Thanks I will try this.

Prajakta Khire
July 4, 2013

I have replaced Localhost with IP address 'http://192.168.0.122:8080/login.jsp' I have changed the Base URL as well. But still I am not able to access link from other PC.

When i have tried to ping the 192.168.0.122 i am able successfully ping that.

1 vote
Justin Alex Paramanandan
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 Champions.
July 4, 2013

From what I noticed earlier, you initially have a base URL of http://localhost:8080/UnosysJira; and now you updated it to http://192.168.0.122:8080/login.jsp. Am I right thus far?

If this is the case, you are almost there. First off, check the below section in your $JIRA_INSTALL/conf/server.xml:

<Context path="/jira" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">

What is the value of the Context path section? Is it "/UnosysJira"? Or is it just ""? Since you would like to use http://localhost:8080/UnosysJira as the base URL, change the section above to the following:

<Context path="/UnosysJira" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">

After you've done this, restart JIRA.

Once JIRA has started up, go to http://localhost:8080/UnosysJira. You should be able to access this. After this, update your base URL to be http://192.168.0.122:8080/UnosysJira.

Let us know how this goes. :)

Dipti Ranjan Behera
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 Champions.
July 4, 2013

@prajakta,

@Justin is absolutely right and you should follow the installation guide carefully again.

0 votes
Prajakta Khire
July 4, 2013

Hello Justin and Dipti,

The problem has been solved. The problem is with the Firewall. I have turnoff the firewall and it works successfully.

Thanks

Prajakta

Justin Alex Paramanandan
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 Champions.
July 4, 2013

Cool! Glad that the suggestions worked for you, mate! Let's keep this question clean with accepted answers so that future users can refer to this for their questions! :)

Dipti Ranjan Behera
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 Champions.
July 4, 2013

great work :)

0 votes
Justin Alex Paramanandan
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 Champions.
July 4, 2013

Hmm, that's strange. Can you check whether your firewall is blocking incoming connections to your system? If it is, might be the root cause of your problem.

Also, if you can't telnet, then it is the firewall issue: telnet 192.168.0.122 8080

Justin Alex Paramanandan
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 Champions.
July 4, 2013

One last thing: if you're on Windows, make sure that the hosts file (inside %systemroot%\system32\drivers\etc\) has not been tampered with. This may cause issues as well.

0 votes
Prajakta Khire
July 4, 2013

Hi Justin,

Thanks Justin.

'http://192.168.0.122:8080/Unosysjira' is working fine with suggested changes. This URL is now accessible on the same machine where I have installed JIRA and MYSQL. But still I am not able to access this URL across the network. What changes I have to make to run this URL accross the Network.

Thanks

Prajakta

0 votes
Prajakta Khire
July 4, 2013

I have replaced Localhost with IP address 'http://192.168.0.122:8080/login.jsp' I have changed the Base URL as well. But still I am not able to access link from other PC.

When i have tried to ping the 192.168.0.122 i am able successfully ping that.

0 votes
Dipti Ranjan Behera
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 Champions.
July 3, 2013

Hi Prajakta,

If jira and mysql are in same machine , then using localhost is not a problem.

But if both are in different machine , then you have to provide machine IP or machine name.

For accessing over the network , your setup machine should be available in the network.

Prajakta Khire
July 4, 2013

JIRA and MySQL are on same machine by i need to access over network

I will try your suggestion. and let you know.

Prajakta Khire
July 4, 2013

I have replaced Localhost with IP address 'http://192.168.0.122:8080/login.jsp' I have changed the Base URL as well. But still I am not able to access link from other PC.

When i have tried to ping the 192.168.0.122 i am able successfully ping that.

Suggest an answer

Log in or Sign up to answer